Hi all,

I just want to know if there any asp code can make auto redirect from one page to another page when the session timeout end ?

Any solution for this problem ?

I need a solution ASAP, so help me please.

Thank You.

Recommended Answers

All 7 Replies

Easy mode: do the following in Web.config

<configuration>
  <system.web>
    <sessionState
      mode="InProc"
      timeout="60" />
  </system.web>
</configuration>

and follow this blog which is talking about how to redirect to another page when session timeout elapsed. HERE

You can use property of your web.config:

<forms name="YourAuthNameIs" 
       loginUrl="~/Home.aspx" 
       defaultUrl="~/Default.aspx" 
       protection="All" path="/" 
       cookieless="AutoDetect"/>

When the expiration occurs they will be sent to the page that loginUrl is set to.

HI

Session is store a unique idetification of user on server.

hi dear
<% response.redirect[“myNewURL”] %>
use this code under the Seesion expire code.

<%
'Start the session and store information
Session("TimeVisited") = Time() 
Response.Write("You visited this site at: " & Session("TimeVisited"))
%>

<%
Dim mySessionID
mySessionID = Session.SessionID
%>

<%
Session.Timeout = 240
Response.Write("The timeout is: " & Session.Timeout)
%>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.