regarding session timeout

  • Thread starter Thread starter Yadnesh
  • Start date Start date
Y

Yadnesh

Dear all,
I am facing a problem in asp.net .As you might be knowing
that any asp.net application has web.config file
where you can change the timeout period.
What I want is to redirect a user to the login page once
his/her session is expired by using Session_onEnd method
in the Global.asax file.
I have tried Response.redirect in that method but it is
also not working .I need immediate help on this topic.
Any solution on this problem will be a great help.
 
How should user's browser know that Session_onEnd happened on the server?
;)
This must be checked by the browser periodically.

Create a special frame in your web application and put there code like this:

<META HTTP-EQUIV="REFRESH" CONTENT=5>
<script language="VBS">
Sub Q()
top.location="http://www.microsoft.com"
End Sub
</script>

<%
If Session("UserName")="" then
response.write("<body onLoad=""vbs:Q()"">")
End If
%>

This causes that the page will be refreshed each 30 seconds and check if
still logged. If not, the browser will be redirected.
 
Back
Top