Welcome to WebmasterWorld Guest from 18.207.136.184

Forum Moderators: ocean10000

Message Too Old, No Replies

global.asa Session OnEnd alert

global.asa Session_OnEnd alert

     
9:14 pm on Jan 13, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:July 4, 2009
posts: 51
votes: 0


Hi friends,

I am trying to edit my global.asa such that it sould pop up an alert to the user whenever the users session expires.

Could not find what line to add to the file.

Thank you for your comments.

11:43 pm on Jan 13, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


Unless the person still has the browser open to one of the pages on that site its not possible to do (show a message that is). I seen it done with javascript which has a two simple timers. (1) it hits zero it pop's up a warning saying the session is about to time out. (2) runs longer then the first, and when it hits zero it redirects to the logoff page (logoff destroys the session).
8:02 pm on Jan 14, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:July 4, 2009
posts:51
votes: 0


Hi Ocean10000,

This is a good idea too but what about the global.asa?
Is it not possible to do this with global.asa?

8:53 pm on Jan 14, 2010 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 20, 2007
posts:588
votes: 0


Its difficult to use this route, as you would need to get the page to constantly ping the website, the global.asa to set application variables when expired, and then to also remove the variables once the information reaches the browser.

A much easier and sensible method (which I've previously done), is to have your pages reference a javascript which is timed to popup a message about 1min before the session is set to expire.

Here's a cruide untested example:
var t=window.setTimeout("if (confirm('continue session?')){window.reload}",1100000)

6:35 pm on Jan 16, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:July 4, 2009
posts:51
votes: 0


Ok seb7, great idea but not sure how to use that variable "t" within the page.
12:05 pm on Jan 17, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:July 4, 2009
posts: 51
votes: 0


Ok I've entered the code as it is. Now the message pops up but when the selection is ok, nothing happens. (The page does not refresh itself).
The code:

window.setTimeout("if (confirm('continue session?')){ window.reload }",5000) ;

9:39 pm on Jan 18, 2010 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 20, 2007
posts:588
votes: 0


This should work better..

var t=window.setTimeout("if (confirm('continue session?')){window.location.reload()}else{location='logout.php'}",5000)

Ignore the var t, its only there to collect the timer object reference which is useful if you want to cancel the timeout.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members