This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

How to keep user logged in for 2 weeks

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I'm a bit lost and need some guidance. I've just inherited this web application written in spring/hibernate and I'm trying to get myself familiar with this technology.

One of the first things I need to do is to keep the user logged in for like 2 weeks or till he explicitly logs out. The application runs on Tomcat - and I think by default - if there is no activity - the user is being logged out in 20 mins.

I know to keep the user logged in for 2 weeks or so - we have to use cookies and set the max age or something. Are there any articles that talk about how this is done.

In this application, I dont even see any LoginController. All the pages that require login are marked in web.xml - When any of those pages are requested - the login.jsp page shows up and if I look in the form action - it says j_security_check.

So I'm not even sure, which controller I should be using to set cookies and stuff. If anyone can guide me a little, I will really appreciate it.

Thanks
--Gubloo
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you are seeing in the login page is just the simplest way to handle security in Spring MVS and Spring. So the Controller is a built in class in Spring MVC that is handling it, not any Controller class in your application.

Let me know if this link helps
http://static.springframework.org/spring-security/site/reference/html/remember-me.html

Mark
 
Gilbert johnson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Mark - That link seems very informative. I will go through that. Thanks a lot for sharing that information. Appreciate it.
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!