----- Original Message -----
From: Alvaro Fuentes <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 11, 1999 11:53 AM
Subject: Session tracking problems
> We are developing a group of servlets that need to share some info
> stored in a session. The first servlet creates the session and the other
> ones retrieve the info from that session. The problem is that those
> servlets which call
> req.getSession(false) seem to behave randomly: sometimes they get the
> session, sometimes they just return null. I think this is because of
> servlet-reloading when compiling: if we delete ALL servlets (.class),
> then compile and call servlets, there's no problem. But if we
> individually compile one servlet, this will not get the session info
> correctly.
> Is it possible?
> Any other possible cause?
> We're using JRun and Netscape Server.
>
> Thanks
>
Hi Alvaro,
request.getSession(false) will NOT work for you, it will return null (or
should according to the specs).
no matter if you are creating a new session object or getting an existing
one, use request.getSession(true).
Spec says that this will return either a new session of none exists for this
client session or an existing one if
the sessionid is valid.
Hope this helps
Andy Bailey
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html