Session End problem

A

angus

Hi All,

I have a Session_End function in global.aspx, initially, i want to redirect
to the login page if the session has been timeout.

I have used the debugger->break on the session_end function, and i know that
this function will be execute once the session has been timeout. however,
the redirectation of the page of login.aspx is failed.

Why is it so? and how to achieve that?

Thank you

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)

' Fires when the session ends

Response.Redirect("login.aspx")

End Sub
 
J

Jignesh Desai

Session ends when user has left the site... for IIS if there is no activity
it assumes user has left the site.
so logically when session end, the server can;t redirect the user, browser
may be closed or user is on some another site.

On the other hand if your are doing forms based authentication , user will
be automatically redirected to login page in case his session expires.
nothing to do anything special in session_end event.

HTH
Regards,
Jignesh Desai.
 
K

Kevin Spencer

A Response is always in Response to a Request. Without a Request, how can
there be a Response?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top