Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Please suggest me that how can i stop to save my web pages on browser after logout.

i have use some code .
Please tell its right way or not
ITS URGENT

Session.Clear();
Session.Abandon();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(1));
Response.Cache.SetNoStore()





Thanks in advance code project team
Posted

1 solution

You can prevent loading of anything from the Web site and you can prevent caching. You cannot prevent saving of any resources which are already loaded, even if caching is not working. And you cannot prevent saving anything which is already cached.

Just thing about it: all the data is already on the client site. What can possibly prevent the user from using it? It's already there. The server code, whatever it is, does not have any control over this data.

As the question is just about "page save", not caching, authentication or access to resourced according to some permission, the answer is: "no, you cannot stop it".

—SA
 
Share this answer
 
Comments
krumia 24-Mar-12 2:24am    
Agreed, and adding to that, you should always write your server code keeping in mind that the data you sent is there in the client. So you should keep that in mind when you write validations.

Commenting about caching, even that is not at your total control. You just send an HTTP header saying to the client 'not to cache', but client can ignore that. You're at mercy of client and intermediate routers, proxies there.
Sergey Alexandrovich Kryukov 24-Mar-12 6:23am    
Good point, agree.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900