Active Server Pages Programming (ASP)/Prevent going back to previous page

Advertisement


Question
I dont seem to be able to use the response.expires. What is it and how does it work ? is it the property that sets the timeout?
-------------------------
Followup To
Question -
I believe a million people have already asked what i'm about to ask, but i don't seem to be able to find the answer online.

I'm building a .NET based login pages and was wondering how do i prevent users from going back to the previous page by clicking the back button. When i've logged out of my secured pages, using FormsAuthentication.SignOut() , i'm still able to reach the secured pages by clicking on back. I've noticed that some other secure sites like yahoo mail and hotmail have done it successfully. When user click on the back button, a message saying ' the session has already expired' kind of stuff.

How do you achieve that using ASP.NET ?
Answer -
Hi

Sorry I was away...

You can put this on the page

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

this will not cache the page.

Happy Programming!!

-Srini

Answer
Hi

I am Back!... Sorry for the delay in reply.  I had a long business trip to Florida (did'nt goto any park! :( )

Here is the URL explaining how to use the response.expires

http://www.dotnet247.com/247reference/msgs/53/266781.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/passport25/NET_

Thanks for your patience!

Happy Programming!

-srini

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.