Solved

Right way to destroy a cookie

Posted on 2006-11-11
6
767 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
currencylayer API intergrate to ASP 25 65
Highlight a word from some text 16 48
JQuery Date Time picker not showing 29 109
How to show result of a NULL value at random? 32 36
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now