You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julian Salerno <ju...@practica.com.au> on 2001/05/09 08:54:50 UTC

session.getId() return value inconsistent - container management bug ?

hi all.

I have a code snippet :
////
  HttpSession session = req.getSession(true);
        System.out.println("session = "+session);
        System.out.println("session.getId() = "+session.getId());
////

On the http client side a test scenario involves Winblows, IE 5.something,
(Security - allow everything, restrict nothing).

Problem : the id of the session keeps changing !!!

HttpSession.getId() javadoc states : "Returns a string containing the unique
identifier assigned to this session. The identifier is assigned by the
servlet container and is implementation dependent."

Unique identifier for the session !!
Does this mean that the tomcat servlet container could be doing something
wrong ??

Here is some output. Note that the session is definitely the same across the
requests:

REQUEST_0
dispatcher = org.apache.tomcat.facade.RequestDispatcherImpl@66afb3
session = org.apache.tomcat.facade.HttpSessionFacade@20bf2c
session.getId() = gx1z2azbz1

REQUEST_1
dispatcher = org.apache.tomcat.facade.RequestDispatcherImpl@60e128
session = org.apache.tomcat.facade.HttpSessionFacade@20bf2c
session.getId() = mgqzufzc31


any ideas ??