Re: Global.asax

From: Philip Q [MVP] (wisemonk_at_mvps.org)
Date: 04/23/04


Date: Fri, 23 Apr 2004 22:15:39 +1200

ruca wrote:

> Hi,
> How can I Redirect my web application to a page when a session ends? (I've
> set a timeout)
>
> I have this in my Global.asax in Session_End Event:
> Context.Response.Redirect("login.aspx")
>
> but it doesn't work
>
>

The Session_End event is meant for clearing up any objects or items that
you have created for the session, you cannot interactively do anything
with the user.

When a session closes, it is usually because of a timeout because the
user has not requested anything from the server and the connection has
been lost (eg. the user has closed the browser).

The Session_End event is not triggered by the user, so you cannot do
anything with it.

You can only redirect the user when the next session starts again.

-- 
Philip Q
Microsoft MVP [ASP.NET]


Relevant Pages

  • Help Needed: Cant Successfully Perform Server-side Redirection
    ... The only problem that I really have is session timeouts. ... situations and redirect the user to the Logon page. ... If Not IsLogonPage And Not IsLogOffPage Then ... Dim ExpirationInterval As Integer = Settings.TimeoutMinutes ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Web.Config Timeout Expired Redirect Custom Error Page
    ... The ASP.NET session timeout is a passive not an active action. ... if the session has timed out and then redirect to another page. ... > timeout set in the config file expires. ...
    (microsoft.public.dotnet.general)
  • Re: session value lost
    ... >into as sessionvariable (username). ... So I redirect to my search.aspx. ... >I save the recordid to the session and redirect to work.aspx. ... >new sqlstring I fetch the data from the sqlserver. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Global.asax
    ... How can I Redirect my web application to a page when a session ends? ... set a timeout) ... Hope this help you ruca ...
    (microsoft.public.dotnet.languages.vb)
  • Global.asax
    ... How can I Redirect my web application to a page when a session ends? ... set a timeout) ... Hope this help you ruca ...
    (microsoft.public.dotnet.framework.aspnet)

Loading