You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vikas Jain <vi...@daffodildb.com> on 2006/05/25 14:36:44 UTC

how to persist a session

Hi,

I am using java server faces. My web server is Tomcat5.0.

I want to persist my session that is the session should continue until user
logs out. I don't want to do this task through <session-config>
<session-timeout>0</session-timeout>

</session-config>

in web.xml.

 

Any help will be highly appreciated...

 

 

With Thanks And Regards

Vikas Jain

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.1/347 - Release Date: 5/24/2006
 

Re: how to persist a session

Posted by Michael Echerer <me...@tngtech.com>.
Vikas Jain wrote:
> Hi,
> 
> I am using java server faces. My web server is Tomcat5.0.
> 
> I want to persist my session that is the session should continue until user
> logs out. I don't want to do this task through <session-config>
> <session-timeout>0</session-timeout>
> 
> </session-config>
> 
> in web.xml.
> 
>  
> 
> Any help will be highly appreciated...

A cookie based approach might not be feasible for a lot of data and
Ajax/Javascript tricks to persist a sesssion by reloading something
(e.g. a .gif) require Javascript, of course.

However JSF or Tapestry 4.0 support persistance of client-side session
state by configuration means.

See:
http://www.theserverside.com/news/thread.tss?thread_id=33991
http://howardlewisship.com/blog/2005/04/property-persistence-on-client.html
For Tapestry just use: <property name="myProperty" persist="client"/>

In case you neither want to use JSF or T4 you might still create your
own session state serialization/deserialization code/jsp tags to do it.

However be aware that you must not trust client data and that you might
pass huge hidden fields along with each request. Crypting data is
recommended.
Using client-side state you won't even need a log out anylonger, except
in order to "reset/clean" state.

Cheers,
Michael

> 
>  
> 
>  
> 
> With Thanks And Regards
> 
> Vikas Jain
> 
>  
> 
> 



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


Re: how to persist a session

Posted by Mikolaj Rydzewski <mi...@becomo.com>.
Vikas Jain wrote:
> I am using java server faces. My web server is Tomcat5.0.
>
> I want to persist my session that is the session should continue until user
> logs out.
Use HttpSessionActivationListener

http://www.docjar.com/docs/api/javax/servlet/http/HttpSessionActivationListener.html


-- 
Mikolaj Rydzewski  <mi...@becomo.com>
Becomo S.A.
tel. (12) 2927104