Logging off an aspx page but I am to browse back to page

G

Guest

Hello everyone,
I created a logon page using C# ASPX, I have the user logon and if logon
information is correct I do a Response.Redirect(url); On the second page it
displays data and I have a logoff button which does another
Response.Redirect(main url); Here is the issue, I am able to browse back to
that page and the data is still populated and visible. How can I clear the
cache for that page? I have tried:

Response.Expires = 0;
Response.ExpiresAbsolute = DateTime.Now;
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

And no such luck. I would appreciate the help.
Thank you,
Terry
 
G

Guest

Try using session variables.
set a session variable saying the user is "authenticated" when the user
logons.
and on logoff, set that variable to say the user is not authenticated.
and on the second page, right at the top, check that session variable to see
if the user is authenticated or not.....if not...redirect the user back to
logon page.
 
G

Guest

I have had a similar problem with a shopping cart checkout page. Once the
user checks out you don't want them going back to this page.

What I did was add this to the checkout page

<head>
<script language="javascript">
history.forward();
</script>
</head>

This gives the effect of a disabled the back button. So what happens is when
the user leaves the checkout page and then tries to use the back button, they
are redirected back to the page they are currently viewing... hence they can
never use the back button to go back to the checkout page.

You may be able to use a trick like this. Just add that code to the logon
page and the user will never be able to go back to that page using the back
button.

Hope this helps.
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top