Solved

Right way to destroy a cookie

Posted on 2006-11-11
6
772 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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