Hi all,
I would like to retrieve the remaining time of the user session. Is this possible?
Example, if am idle for 20 minutes then the session.timout fire's up. I only need to be able to know in how much time the session will effectivly timout.
I assume you don't want an ASP to report this, as every page would report the full time remaining, as every page would reset to timeout countdown.
Hence, if you DO want this, you may as well just return the Session duration (Session.Timeout).
codestorm
Fire bad. Tree pretty. - Buffy
Kludges are like lies.
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
I use javascript to track the remaining time in the session (client-side) since, as codestorm says, every server hit restarts the clock.
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
Thanks for your replies guy's.
Yep I was aware of this, and maybe the second solution would be my best bet. The only thing I want to do is put in the status window, the remaining time of the user's session before he get's timout. The users in my case have different timout values that I set in the user's table and when they log in I set the session.timout to be equal to the user timout settings.
So I only want to show him the remaining time of his session via the status bar. Of course, when he will be working, this time will always reset to the initial value, but this will be usefull when example he had left for what ever reason and come back to his screen.
Is this still possible with javascript client-side? if so.. is it possible to point me out to a starting snippet or something as I really have no clue at the moment.
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
I'm glad it works for you, I just noticed that then the time runs out, it calls closeWin(). You may want to say
if (timeLeft < 0) {
document.location = "login.asp"
}
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
Yes, thanks, I already had a routine that when the session runs out the pages get redirect to the login.asp page.
But the piece of code you post for the display of remaining time is very very helpfull as it is what I wanted.
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.