Hi Chema

I take your point. But this is a problem solved by JSR168/286 portal implementations. Perhaps you could use a portal for your purposes? Otherwise I would suggest taking a look at Apache Jetspeed or Liferay source code to see how they implement cross-war session sharing. Both portals can be hosted by multiple J2EE containers, so their solution must be independent of Tomcat.

Regards

Ron

----- Original Message ----- From: "Chema" <demablo...@gmail.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Saturday, August 06, 2011 10:54 PM
Subject: Re: Sharing session between different webapps under same tomcat


Hi Ron:


My understanding is that once these options are confgured, the SAME session
data is stored across contexts separately for each user.

Thanks for you answer, but in the last seccion of that webpage
(Session-aware cross context data sharing), explains that:

- he's sharing data using ServletContext. Its scope is the application
scope, not the session scope.
- to make it session-aware , he creates a hashmap in application scope
, indexing by JSESSIONID

So, it's a trick: use the session1's ServletContext as a global store
and access to it from session2, cause crossContext="true"
Works but it's a trick because it's not managed by Tomcat

There is no need to
do anything special - the session will be explicitly invalidated when the
user logs out, otherwise when the session timeout is exceeded.

If I dont free resources from this hashmap manually when a session is
invalidated, Tomcat doesn't ( except when restarting )
That can be a problem if store big objects, like user information


Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to