Click here to Skip to main content
16,019,043 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can we delete cookies when submit button becoz if We press f5 key then duplicate entry insert into data base so how can we delete cookies..
Posted

You need to fix your code in the first place. In general, your question makes no sense. You said 'how can we do xxx, because my code is broken, and without showing you the code, I've assumed that this is how to fix it'. As deleting cookies is something that's very easy to find out how to do, using google, odds are good that you'd do better to show us your code, and let us tell you how to fix it, rather than assuming that this[^] will fix it.
 
Share this answer
 
Hi,

For doing so you need to set the expiration date and time.
This is how you can do.

The below code is in C#, you can convert the same to which ever language you want.

Response.Cookies["YourCookieName"].Expires = DateTime.Now.AddDays(-1d);



Regards

Shiv
 
Share this answer
 

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