Log Out issue
-
i have implemented this code on the logout button FormsAuthentication.SignOut(); Session.Abandon(); Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; Response.Redirect("~/frm_default.aspx"); but when i click on back button i am able to go the previous page.
-
i have implemented this code on the logout button FormsAuthentication.SignOut(); Session.Abandon(); Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; Response.Redirect("~/frm_default.aspx"); but when i click on back button i am able to go the previous page.
-
i have implemented this code on the logout button FormsAuthentication.SignOut(); Session.Abandon(); Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; Response.Redirect("~/frm_default.aspx"); but when i click on back button i am able to go the previous page.
if u r using master pages, code this in page load of master page or in page load of everypage Response.Expires = 60; DateTime now = DateTime.Now.AddMilliseconds(-1); Response.ExpiresAbsolute = now; Response.AddHeader("pragma", "no-cache"); int timeout = (Session.Timeout + 1) * 60; Response.AddHeader("Refresh", timeout.ToString()); Response.AddHeader("cache-control", "private"); Response.CacheControl = "no-cache"; if (Session.IsNewSession) { Response.Redirect("~/Default.aspx"); } and in logout Session.Abandon();
-
if u r using master pages, code this in page load of master page or in page load of everypage Response.Expires = 60; DateTime now = DateTime.Now.AddMilliseconds(-1); Response.ExpiresAbsolute = now; Response.AddHeader("pragma", "no-cache"); int timeout = (Session.Timeout + 1) * 60; Response.AddHeader("Refresh", timeout.ToString()); Response.AddHeader("cache-control", "private"); Response.CacheControl = "no-cache"; if (Session.IsNewSession) { Response.Redirect("~/Default.aspx"); } and in logout Session.Abandon();
-
i have implemented this code on the logout button FormsAuthentication.SignOut(); Session.Abandon(); Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; Response.Redirect("~/frm_default.aspx"); but when i click on back button i am able to go the previous page.
browser cache always remains open.. you cant erase bowser cache programmatically. Only you can do, is when user clicks anything on a page after logoff, throw some error messages.
Abhishek Sur My Latest Articles Basics on LINQ and Lambda Expressions
Create .NET Templates -
i have implemented this code on the logout button FormsAuthentication.SignOut(); Session.Abandon(); Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; Response.Redirect("~/frm_default.aspx"); but when i click on back button i am able to go the previous page.
Hi, On the Page Load write if Session("UserId")="" then Response.Redirect("Login.aspx") end if if you click back now, the page will execute the page load na...it will go to login page. Ramesh Sambari