Sunday, June 23, 2013

How could I implement session timeout in Spring?

What a mess?!! I spend the whole morning to figure out how could I implement a session control over a user today. Being able to authenticate a user in a system is a good start, what if I want to enforce some session rules, say logout a user when the user idle for 5 minutes. I though Spring have some kind of special session management? Nope, no such thing. Just define it in Deployment Descriptor as shown in the following code will do.

   5

Take note that the number in session-timeout tag represent in minute.

No comments: