Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirect user to login page after session expires  RSS feed

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a filter.

And you should be checking for a scoped variable that you place in the session, not the session itself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!