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