I have a asp.net mvc website. And I want to deny access to a particular folder and its contents on this website. I have done that in web.config denying access to anonymous users, using the following:
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
Now I am facing a problem, when I try to access a file from this folder after logging out.
If I try to access any file, say a text file, without logging in, from the browser URL, it redirects me to the login page as expected.
The URL for example is: "https://www.mywebsite.com/Content/MyNotepad.txt".
If I hit this above URL after logging in, the file opens, again as expected.
But it is after the logout that I am facing the problem. The file remains accessible even after signing out. Its only when I to do a Ctrl+F5 it redirects me to the login page.
I know this is some caching that is causing this to happen, but I am unable to find a solution for this. Any help is appreciated.