tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Vanlerberghe <>
Subject Re: Session creation speed
Date Tue, 23 Jan 2001 12:32:03 GMT
Note that this only happens for the very first session that is created
after tomcat is started.

All following session id's will be generated much faster, it's only the
initialisation of the secure random number generator that takes a long

The latest versions of tomcat (both the 3.x and 4.x versions) address
this problem by initialising the generator when tomcat starts instead of
waiting until the first session id is needed. I'm not sure this is
already present in the release versions...

You can use the simple java.util.Random class during development, but
for production, you should use the SecureRandom class to prevent anyone
from guessing your session id and taking over from another browser...

Luc Vanlerberghe

Steve Smale wrote:
> Im having problems with creating sessions with a servlet in tomcat.
> When the getSession line is reached in the code it freezes for around 9-10
> seconds before returning a session, leading the user to think theyre not
> going to get anything back...
> This only seems to be the case with new sessions being created;  - once
> the session is established, future access to the servlet is an acceptable
> speed for the duration of that client's session.
> Im testing it with netscape 4.71/linux and a standalone tomcat server...
> Anyone else had this problem?
> --
> Steve Smale
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

View raw message