Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sirs,

i am using C# and i need to Delete all Cache and Cookies after a special button Clicked
Posted

See here: http://support.microsoft.com/kb/326201[^]
This clears the cache and the cookies.
 
Share this answer
 
This[^] might actually help you out.
 
Share this answer
 
C#
// Clear cache
               Response.Cache.SetCacheability(HttpCacheability.NoCache);
               Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
               Response.Cache.SetNoStore();

               //Clear cookies
               string[] cookies = Request.Cookies.AllKeys;
               foreach (string cookie in cookies)
               {
                   Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
               }
 
Share this answer
 
v2

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