Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variable Not Expiring after 1 minute

Status
Not open for further replies.

OutInLeftField

Programmer
Apr 30, 2002
37
US
Hello Everyone,

I have an application that uses active directory authentication. I also use session variables to timeout the application after one minute for testing. When I finally get it to work, I'll set it for five minutes. Now the problem.

Page that sets up session.

session.Timeout = 5.
response.redirect "menu.asp"



Menu.asp page contents

<%if session("group") = "" or isnull(session("group")) then%>
<script>
history.forward();
</script><%
response.redirect " end if%>
<html>
<head>
<!--#include file="authenticate.asp" -->
<META HTTP-EQUIV="refresh" content="80;">
.
.
.

rest of code of page




The include file is the code that checks the login against Active Directory. The refresh line refreshes the page after 80 seconds.

What happens is after 80 seconds, the page refreshes. but the page doesn't redirect to the "notallowed.asp" page. But on the second time it refreshes, the page is redirected and the history.forward(1) prevents the user from using back button.

How can I have the page redirect AFTER the First Refresh not the second??

Thank you
 
Try setting a session variable to 1 after the first refresh. Have the page check that variable each time to see what it's value is. If it's a 1 then do the second refresh and reset the session variable to 0.
 
The

<%if session("group") = "" or isnull(session("group")) then%>

code does just that. when the page reloads or refreshes after 80 seconds, the session variable ("group") should be empty because at 60 seconds the session should expire.the program should redirect to the notallowed page.

The session isn't expiring at one minute. Is there some way to check on this via IIS?
 
This line
Code:
session.Timeout = 5.
certainly isn't setting your timeout to 1 minute, it's setting it to 5.
 
my apologies.

My testing environment has set to 1 minute because I don't want to sit there for 5 minutes to wait to see if it reloads redirects...

I'll change it to 5 minutes in production.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top