tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob S." <>
Subject Re: Preserving session variables across contexts
Date Thu, 23 Aug 2001 11:40:57 GMT
>From the servlet specification:

Section 7: Session Scope

HttpSession objects must be scoped at the application / servlet context level. The underlying
mechanism, such as the cookie used to establish the session, can be shared between contexts,
but the object exposed, and more importantly the attributes in that object, ***must not be
shared between contexts.***

It pays to read the spec before designing =/

All I can think of is storing them in a database based on session ID?

- r

On Thu, 23 Aug 2001 14:34:26 -0400 wrote:
> Hello,
> It is possible to have session variables preserved across Tomcat
> contexts?
> For example,  if a  user  accesses
>  /<hostname>/ABC/somePage.jsp
> and is redirected to=3D20
>  /<hostname>/XYZ/aDifferentPage.jsp
> can the session variables that were present during the first page be
> preserved??   If so, what is the technique needed to achieve this?
> We seem to be losing our session variables in website we are developing
> when we navigate to a different context even though it is on the same
> server.  It will not be convenient for us to put everything under one
> big context so I was hoping to get a solution to this.
> Thanks,
> Keith

View raw message