Solved

Right way to destroy a cookie

Posted on 2006-11-11
6
768 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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