How to prevent a logged-out user from navigating to past pages?

G

Guest

Hi,

After the user is signed out and taken to the login page, they can still use
the back & history features in the browser to access pages. Every page
(except login) has a check at the beginning to redirect the user after being
logged out, but when the page is accessed via back button, the debugger
doesn't stop at that code b/c the page is cached and is not generated at the
server.

How can I make these pages disappear from the history?

Thank you in advance,

Richard
 
G

Guest

Hi Richard,
you have to turn off caching of your web pages on client browser. Put
following directive <%@ OutputCache Location="None" VaryByParam="None" %> to
each page you are securing by authentication so when client press back button
it will force browser to request the page from server and to load it from
cache.

You can also make caching profile in your web.config file and load profile
in your pages, your settings will be centralized.

<system.web>
<outputCacheSettings>
<outputCacheProfiles>
<add name="myProfile" location="None" VaryByParam="None" />
</outputCacheProfiles>
</outputCacheSettings>
</system.web>

Each page will refernce your profile by adding this directive:
<%@ OutputCache CacheProfile="myProfile" />

Best regards,
Ladislav

<

Regards,
Ladislav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top