Posted on: 4/2/2014 8:45:36 PM | Views : 593

I do not need the user to be automatically redirected to the login form when his session expires, although that would be nice. For me, it is enough if, after the user has been idle for X minutes and then tries to access a page in my website, he is redirected at that time.
I am using Vistual Studio 2013 Express Update 2 CTP. I have the following code in my Page_Init:
protected void Page_Init(object sender, EventArgs e) { if (Session["myVar"] == null) { if (User.Identity.IsAuthenticated) { FormsAuthentication.SignOut(); FormsAuthentication.RedirectToLoginPage(); } } if (IsPostBack) { // blah blah blah } else { // blah blah blah } } My application is based on the "ASP.NET Web Application" template included in VS 2013 Express for Web. myVar is a session variable ...

Go to the complete details ...