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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect page when Session("ID") expires

Status
Not open for further replies.

deharris2003

Programmer
Jul 1, 2003
41
US
I'm not really good with javascript. I have a asp based site that uses session variables to track the current user. Problem is that after 20 minutes the session variables expire. I want to find away to alert the user to re-logon. My current test code will redirect the user but it does not show the message to the user. Any help is appreciated. here is what I currently have.

<%If Session(&quot;ID&quot;) = &quot;&quot; then %>
<script LANGUAGE='Javascript'>
alert('To ensure security, Please Re-enter your ID and Password!')
top.location.href=&quot;logon.asp&quot;
</script>
<%End IF%>
 
the problem with this code is that it will check for the session when the page loads. so at that time if the session is there this JS will not even come. therefore u have to check session in the file that has been called.

<%If Session(&quot;ID&quot;) = &quot;&quot; then %>
<script LANGUAGE='Javascript'>
alert('To ensure security, Please Re-enter your ID and Password!')
top.location.href=&quot;logon.asp&quot;
</script>
<%End IF%>

do u get what i say?

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top