473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to delete a cookie?


I need the statement for deleting a permanent cookie that I created
earlier...

The .NET documentation refers to the .discard property, but the compiler
balks at that property

e.g. Response.Cookies("deleteME").discard()


Nov 17 '05 #1
2 7563
There's a Remove method for the cookies collection that might work for you:

http://msdn.microsoft.com/library/de...emovetopic.asp

MyCookieCollection.Remove(MyCookie)

Another way to remove a cookie is to set the Expire property to a date in
the past.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
news:b6********************@newssvr14.news.prodigy .com...

I need the statement for deleting a permanent cookie that I created
earlier...

The .NET documentation refers to the .discard property, but the compiler
balks at that property

e.g. Response.Cookies("deleteME").discard()

Nov 17 '05 #2
I've never trusted the .remove method.
I always expire the cookie so I know the client will have
the expired data. I should take the time to research the
total affect of .Remove, but setting the date to now - 1
day works so well...
-----Original Message-----
There's a Remove method for the cookies collection that might work for you:
http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/cpref/html/frlrfsystemwebhttpcookiecollectionclassremove
topic.asp
MyCookieCollection.Remove(MyCookie)

Another way to remove a cookie is to set the Expire property to a date inthe past.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in messagenews:b6********************@newssvr14.news.prodig y.com...

I need the statement for deleting a permanent cookie that I created earlier...

The .NET documentation refers to the .discard property, but the compiler balks at that property

e.g. Response.Cookies("deleteME").discard()

.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Phil Powell | last post by:
I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes, the PHP script I run behaves according to this...
3
by: Warp | last post by:
If I have a cookie with 'key/value' pairs, how would I delete a specific 'key/value' pair while preserving the remaining pairs? I tried to do something like: cookie(key)="" but it didn't seem to...
3
by: Ben Amada | last post by:
Every time a user visits a particular page, I'm using the code below to add a cookie that expires in 1 day. My question is, a user may visit this page a few times within one day. Before adding...
3
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code...
0
by: Bill Borg | last post by:
Hello all, Not sure I can describe this adequately, but I am creating an endless loop when an authenticated user signs out. When the user signs out, I want to remove authentication, abandon...
1
by: Henri | last post by:
Hi, My page saves user's login on user's computer using a cookie: Dim expires As Date = DateTime.Now.AddMonths(1) Dim cookie As New HttpCookie("login", loginValue) cookie.Expires = expires...
5
by: ad | last post by:
Hi, How can I delete the cookie in client?
6
by: jojowebdev | last post by:
Do javascript cookies REALLY have to be this hard? function setCookie( name, value, expires, path, domain, secure ) { var today = new Date(); today.setTime( today.getTime() ); if ( expires ) {...
1
by: ja5onkendall | last post by:
I'm trying to create a save to fav's using CFCOOKIE. The cookie is using a primary key from the database and adding on using ListAppend. I can't figure out how to delete a cookie out of the list. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.