You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Glenn O <gl...@greenoak.com> on 2002/12/29 04:48:32 UTC

Is session id guaranteed to be unique?

I'm tracking down a problem which only occurs rarely, but has the 
symptom that when I attach
data to one session, it appears to mistakenly become attached to another 
session. It is almost as if
tomcat is generating two sessions which have the same session id.

I'm looking at the tomcat source for createSession() in 
ManagerBase.java, and I notice this code is
commented out:

       }
       /*
       synchronized (sessions) {
           while (sessions.get(sessionId) != null)        // Guarantee 
uniqueness
               sessionId = generateSessionId();
       }
       */
       session.setId(sessionId);


Does that mean tomcat could occasionally produce duplicate session id's?






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>