When I click the back button in IE10 or Chrome on Win7, it does not affect my breakpoint in my MVC. The Network tab in IE Developer Tools shows that 304 has not been changed and Fiddler has not completed the request.
I was expecting the message to return, so I could work in my controller. In my case, the error is:
- To come in
- make sure you are on the default page
- Click the "Back in Browser" button in the upper left corner. You will now be returned to the login screen
- log in again with the same credentials when you do this - I get the โProvided anti-fake token is for the userโ, but the current user is โusernameโ.
I tried putting this in my controller without success:
this.HttpContext.Response.CacheControl = "private"; this.HttpContext.Response.Cache.SetMaxAge(TimeSpan.FromSeconds(0)); public ActionResult Index() { // Get: /Home/Index if (this.User.Identity.IsAuthenticated) { // send the user to the GlobalAssetDashboard return this.RedirectToAction( "GlobalAssetDashboard", "Dashboard", new { area = "DashboardArea" }); } return this.View("Login"); } public ActionResult Login() { // GET: /Home/Login if (this.User.Identity.IsAuthenticated) { // send the user to the GlobalAssetList return this.RedirectToAction( "GlobalAssetDashboard", "Dashboard", new { area = "DashboardArea" }); } return this.View("Login", new LoginModel()); }
Is there a way to force a response back or detect this and trigger an update in JavaScript? Or maybe my management methods are implemented incorrectly?
source share