Right way to destroy a cookie

Whats the correct method to destroy a cookie?
Lets say I set a cookie ( response.cookies("err_bit")="No User Found") when a page loads, read its data and I want it destroyed soon afterthat.
How do I do this? What the right way to do this?
dpinto04Asked:
Who is Participating?
 
GawaiConnect With a Mentor Commented:
either

Response.Cookies("err_bit") = ""

or

Response.Cookies("err_bit").Expires = now() - 365
0
 
jay_gadhaviCommented:
Try this After u have read the data

Response.Cookies("err_bit").Expires = DateTime.Now()

Regards,
jay
0
 
dpinto04Author Commented:
@jay_gadhavi
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'DateTime'
index.asp, line 29
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
dpinto04Author Commented:
What do you think is wrong with your answer jay_gadhavi?
0
 
jmundsackCommented:
jay_gadhavi's answer appears to be ASP.Net, which is why you are getting the error in ASP.

There doesn't appear to be anything wrong with gawai's answer, though.

HTH-Jon
0
 
jay_gadhaviCommented:
Ok guys
I dont know which language u have been used.
0
All Courses

From novice to tech pro — start learning today.