title: ASP.NET Core Identity - Prevent back button after login/logout?
body: <p>I have tried numerous ways to prevent the user from visiting pages they shouldn't be seeing after a successful login and logout. After logging in, the user can click back and visit the login page while still being logged in. After signing out, they can click back and visit every page (despite there being an <code>[Authorize]</code> attribute on the controller relevant in this case. After signing out, when they click back and, for example, land on the home page, it will still display the user's name. (eg. "Welcome, [name]")</p>
  
  <p>I have tried adding <code>[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]</code> to my controller(s), as well as adding a "custom cache filter" to my project I got from <a href="https://stackoverflow.com/a/39613106/8425958">here</a></p>
  
  <p>I'm stumped as to how to do this properly in Asp.net core Identity. Looking through the inspect element option, under the Application tab, there is never anything in cache or application storage. (Not sure if that is relevant at all, if i'm going to be honest.)</p>
  
  <p>EDIT:
  I've tried putting: </p>
  
  <pre><code>    &lt;meta http-equiv="cache-control" content="max-age=0" /&gt;
      &lt;meta http-equiv="cache-control" content="no-cache" /&gt;
      &lt;meta http-equiv="expires" content="0" /&gt;
      &lt;meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /&gt;
      &lt;meta http-equiv="pragma" content="no-cache" /&gt;
  </code></pre>
  
  <p>in the head of my <code>_Layout.cshtml</code> page, combined with the <code>ResponseCache</code> Attribute on my controllers and still no luck.</p>