Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 774
  • Last Modified:

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?
0
dpinto04
Asked:
dpinto04
1 Solution
 
GawaiCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now