| Author |
Redirect user to login page after session expires
|
shah rah
Ranch Hand
Joined: Jan 04, 2007
Posts: 124
|
|
I want to redirect the user to login page if his session expires. He could be on any page and if his session expires he has to be redirected to Login screen.
I am doing this... I check for the session if it is new then redirect him to login page. What's happening is I am writing this piece of code on every page and I am checking for expired session and redirecting him to login.
I want to know if there is one place where we can write the code and user will be redirected to login page irrespective of on which page he is in when his session expires .
appreciate your help
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56207
|
|
Use a filter.
And you should be checking for a scoped variable that you place in the session, not the session itself.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Redirect user to login page after session expires
|
|
|