• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
janek nowakowski
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21155
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write some Javascript which autosaves the contents of the form periodically. Example: GMail does this.
 
janek nowakowski
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for a solution. Are there any other solutions of this problem?
 
janek nowakowski
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
janek nowakowski
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21155
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also do auto-login. Example: this site right here does it.
 
janek nowakowski
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found something interesting here -> user filter by BalusC. I'll check it tomorrow ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic