Forums
This topic is locked
Session.Timeout with Redirect - Please Help!!!
Posted 22 Jul 2003 16:09:13
1
has voted
22 Jul 2003 16:09:13 Katherine Williams posted:
Hello,I really hope that someone can help me out with this. It seems like it should be simple to do, but I'm not sure how.
I simply want to close a window if a user has exceeded the idle time using the Session.Timeout. Here are 2 options that I've come up with so far:
<b>1) OPTION 1</b>
<%Session.Timeout=30
if (Session.Timeout=0){
%>
<script type="text/javascript">
location=("javascript:window.close()"

}
</script>
<%}%>
<b>1) OPTION 1
On a redirect page that sets the Sessions, I put </b>
<%Session.Timeout=30%>
<b>On the main page, I put:</b>
<script type="text/javascript">
function sessiontimeout(){
if (Session("First_Name"

javascript:window.close()
}}
</script>
...but neither of these work. Is there a way to close a window after the Session.Timeout has expired using ASP? If not, is there a way to do so using ASP w/JavaScript? Any help is greatly appreciated.
KWilliams
Replies
Replied 24 Jul 2003 01:32:18
24 Jul 2003 01:32:18 Marcellino Bommezijn replied:
The time the session.variable exists is kept by the webserver. So you have to refresh your webpage with intervals so it's sent back to the webserver (which validates your session.variable) and then create some lines of code that closes the active window based on this information.
Replied 24 Jul 2003 16:28:19
24 Jul 2003 16:28:19 Katherine Williams replied:
Thanks for the suggestion. It's pretty funny, because that's exactly how I set it up. I know that the default session.timeout is 20 minutes, which is plenty of time for my users to be allowed to idle. And I have a refresh set up for 21 minutes. It works fine. Thanks for your input..it's really appreciated.
KWilliams
KWilliams