aspose file tools*
The moose likes Other Application Frameworks and the fly likes How to keep user logged in for 2 weeks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "How to keep user logged in for 2 weeks" Watch "How to keep user logged in for 2 weeks" New topic
Author

How to keep user logged in for 2 weeks

Gilbert johnson
Ranch Hand

Joined: Jul 10, 2005
Posts: 45
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
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Gilbert johnson
Ranch Hand

Joined: Jul 10, 2005
Posts: 45
Thankyou Mark - That link seems very informative. I will go through that. Thanks a lot for sharing that information. Appreciate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to keep user logged in for 2 weeks