Solved

Right way to destroy a cookie

Posted on 2006-11-11
6
769 Views
Last Modified: 2008-02-01
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
Comment
Question by:dpinto04
6 Comments
 
LVL 20

Accepted Solution

by:
Gawai earned 50 total points
ID: 17924103
either

Response.Cookies("err_bit") = ""

or

Response.Cookies("err_bit").Expires = now() - 365
0
 
LVL 3

Expert Comment

by:jay_gadhavi
ID: 17928608
Try this After u have read the data

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

Regards,
jay
0
 

Author Comment

by:dpinto04
ID: 17930323
@jay_gadhavi
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'DateTime'
index.asp, line 29
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:dpinto04
ID: 17930426
What do you think is wrong with your answer jay_gadhavi?
0
 
LVL 13

Expert Comment

by:jmundsack
ID: 17932082
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
 
LVL 3

Expert Comment

by:jay_gadhavi
ID: 17935898
Ok guys
I dont know which language u have been used.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Import csv files to MS SQL 5 85
File download script VBSCRIPT fail on download PPT files 2 61
Connection to multiple databases 13 26
Index on a Table 6 25
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question