Hi,
I have used session timeout along with forms authentication .
I want to sign-out my form when the session time out.
Below I have given the code I have used in Session_end Event.But it is showing some error
"An exception of type 'System.NullReferenceException' occurred in App_global.asax.8zeyl6aa.dll but was not handled in user code"
Thanks
void Session_End(object sender, EventArgs e)
{
if (HttpContext.Current.Request.IsAuthenticated)
{
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage("Session=Expired");
HttpContext.Current.Response.Redirect("~/Login.aspx");
HttpContext.Current.Response.End();
}
try
{
//Code to store the session end time.
}
catch (Exception ex)
{
...
Go to the complete details ...