By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,133 Members | 1,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,133 IT Pros & Developers. It's quick & easy.

Why Response.Redirect is not working in Session_End event?

P: n/a
Hi,
Im trying to use Response.Redirect in Session_End event in Global.asax page,
which is not working. Why this is not working? And if this not works here,
how do I hanlde this? Any possible and best solutions will be helpful.

N.B.: Here my intention is to redirect to, say Login page, when the user
session ends.

Thanks in advance,
K.V.Ravindra Kumar
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ravindra,
Sorry, when the session ends, there is not HttpContext. There is no
active page to redirect. A user can close leave their computer and
disconnect from the Internet, and 20 minutes later this code will fire.
There is no user at this point. What you can do is check to see if the user
is logged in (if they have a session). If they don't then redirect to the
login page. Of course, this code would have to run on every page or in the
authenticate request of global.asax.

You can also put this code in your base page so that on every request you
check that the user is logged in. If not, redirect.

Best regards,
Jeffrey Palermo

"Ravindra" <Ra******@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
Hi,
Im trying to use Response.Redirect in Session_End event in Global.asax page, which is not working. Why this is not working? And if this not works here,
how do I hanlde this? Any possible and best solutions will be helpful.

N.B.: Here my intention is to redirect to, say Login page, when the user
session ends.

Thanks in advance,
K.V.Ravindra Kumar

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.