• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Persistent authentication

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'd like to find a way to persist a login to my Tomcat app across browser restarts. For example, if I use calendar.google.com, I am still logged in after quitting the browser and starting it up again.

Ideally this would be configuration based, or perhaps by plugging in a third party authentication mechanism. Managing my own cookies would be the least preferred route.

Any ideas?
Regards
Oliver
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
provided the data stored on the session is Serializable and the Tomcat insta ce is shutdown cleanly, the session information should be persisted between Tomcat restarts. Or it was last time I checked
 
Oliver Kohll
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I don't mean Tomcat server restarts, I mean client side browser restarts (as long as cookies aren't cleared of course)
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah. Usually session cookies are in memory only, but the easiest way to accomplish this is to write servlet code that reads the JSESSIONID cookie and then rewrite it as a persistent cookie.
 
Oliver Kohll
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That works, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!