File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How to prevent session timeout? How to keep user logged in? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to prevent session timeout? How to keep user logged in?" Watch "How to prevent session timeout? How to keep user logged in?" New topic
Author

How to prevent session timeout? How to keep user logged in?

janek nowakowski
Greenhorn

Joined: Jun 20, 2010
Posts: 8
Hi, can anybody tell me how can I prevent situation when user writes a long review, go for a walk, come back to submit form and he lost all the text because of session timeout? I would be gratefull for any help!!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

Write some Javascript which autosaves the contents of the form periodically. Example: GMail does this.
janek nowakowski
Greenhorn

Joined: Jun 20, 2010
Posts: 8
Thank you very much for a solution. Are there any other solutions of this problem?
janek nowakowski
Greenhorn

Joined: Jun 20, 2010
Posts: 8
I mean, is there solution like "keep me logged in" so if there is session timeout, application search for cookies with login data and the session is restored with actual view. Can it be done in JSF?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

Yes, but it requires a lot of work on the application's part. It's easier just to put a refresh meta-tag on the web page or to extend the timeout limit in web.xml.


Customer surveys are for companies who didn't pay proper attention to begin with.
janek nowakowski
Greenhorn

Joined: Jun 20, 2010
Posts: 8
I thought so (that it's very complicated). I think, I will use refresh meta tag, because it is the simplest solution MANY THANKS!!!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

You could also do auto-login. Example: this site right here does it.
janek nowakowski
Greenhorn

Joined: Jun 20, 2010
Posts: 8
Ok, I can implement auto-login based on cookies, but I'm not sure how will the app react when the session expires. Probably some exception will be thrown and I don't know If I will be able to restore view and a text of a user.
janek nowakowski
Greenhorn

Joined: Jun 20, 2010
Posts: 8
I have found something interesting here -> user filter by BalusC. I'll check it tomorrow ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to prevent session timeout? How to keep user logged in?