473,387 Members | 1,453 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,387 software developers and data experts.

How to delete a cookie out of a list

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.

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="savedJobs" datasource="#request.dsn#">
  2. SELECT *
  3. FROM tbJobs
  4. WHERE jobID IN
  5.  (
  6. <CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" LIST="Yes" SEPARATOR="," VALUE="#Cookie.save#">
  7.  ) 
  8. </cfquery>
  9. <!----------------------Set The Cookie---------------------------------------------->
  10.  
  11. <cfif isDefined("URL.toggle")>
  12. <cfcookie name="save" value="#jobID#" expires="30">
  13. </cfif>
  14.  
  15. <!---------------------Add A Cookie to the List------------------------------------->
  16. <cfset jobID = ListAppend(Cookie.save, #jobID#)>
  17.  
  18. <!-------Here is where I need help???---------------------------->
  19. <cfif isDefined("URL.delat")>
  20. <cfcookie name="save" value="#ListDeleteAt(cookie.save,listfind(cookie.save,jobID))#" expires="now">
  21. </cfif>
Mar 17 '08 #1
1 4020
acoder
16,027 Expert Mod 8TB
If you set expires to "now", it will delete the whole cookie. Set expires to a date in the future.
Mar 18 '08 #2

Sign in to post your reply or Sign up for a free account.

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 ) {...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.