tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron McNulty <rmcnu...@clear.net.nz>
Subject Re: Sharing session between different webapps under same tomcat
Date Mon, 08 Aug 2011 01:36:27 GMT
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" <demablogia@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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


Mime
View raw message