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 [Authorize] 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]")
I have tried adding [ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] to my controller(s), as well as adding a "custom cache filter" to my project I got from here
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.)
EDIT: I've tried putting:
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
in the head of my _Layout.cshtml page, combined with the ResponseCache Attribute on my controllers and still no luck.