System.Web.Security.FormsAuthentication.RedirectToLoginPage(); in Session_end of global.asax. Giving me the problem of "Object reference not set to instance"
First of all, Forms authentication has nothing to do with Session! Forms authentication uses cookies, not session
Session_end in Global.asax is not attached to any Request, it is a process that runs on the server, even when the user already closed his browser of is disconnected, so you cannot access the authentication cookie, resulting in this error
hans_v
All-Star
35986 Points
6550 Posts
Re: Redirect to login page when session expires
May 04, 2012 08:35 AM|LINK
First of all, Forms authentication has nothing to do with Session! Forms authentication uses cookies, not session
Session_end in Global.asax is not attached to any Request, it is a process that runs on the server, even when the user already closed his browser of is disconnected, so you cannot access the authentication cookie, resulting in this error