Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

An auto logout feature

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to have a feature where when you timed out for inactivity that it takes you to a page that says so? Anyone know anything about this? Or maybe even like some credit card companies do... Your session is about to expire do you want to continue and if you dont answer in a certain amount of time you get automatically logged out.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to direct the browser to a different URL you will have to use JavaScript - it has a handy setTimeout() function that will run arbitrary code after a given amount of time expires. That code could send the user to a "you have been loggedout page.
You can use JSP to embed Javascript in the page.
Bill
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a nice little compromise.
I assume we're only talking about the situation where a person visits a page and allows the session to timeout without actually changing the page viewed. If they close the browser or visit another site it will behave differently.
Given that this is client side JS, are there any implications with using the back/forward buttons? As far as I can tell it should still run stably, but I can see a small problem if the user browses through multiple windows - window 1 can timeout and display the timeout page, where window 2 has actually kept the session alive.
Dave
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!