Solved

CFCOOKIE Not Expiring when I set expires="Now" nor when I set expires=#Now()#

Posted on 2004-03-26
5
695 Views
Last Modified: 2013-12-24
My code is this simple...

<cfcookie name="source_id" value=#source_id# expires=#qrySourceDetails.expiration_date#>
<cfcookie name="source_id" expires=#Now()#>
<cfoutput>#IsDefined("cookie.source_id")#</cfoutput> <!--- Always returns "YES" --->

<cfcookie name="source_id" value=#source_id# expires=#qrySourceDetails.expiration_date#>
<cfcookie name="source_id" expires="Now">
<cfoutput>#IsDefined("cookie.source_id")#</cfoutput> <!--- Always returns "YES" --->
0
Comment
Question by:Kamoku-Wan
5 Comments
 
LVL 3

Author Comment

by:Kamoku-Wan
ID: 10688621
I have also tried...

<cfcookie name="source_id" value=#source_id# expires=#qrySourceDetails.expiration_date#>
<cfcookie name="source_id" expires=Now> <!--- Notice no quotes around Now --->
<cfoutput>#IsDefined("cookie.source_id")#</cfoutput> <!--- Always returns "YES" --->

I am at a loss why this is happening?
0
 
LVL 17

Accepted Solution

by:
Tacobell777 earned 125 total points
ID: 10691686
You'll have to navigate away from the page first, if you look up cookies int he cf documents it will tell you why and how, its really helpful..

<cfcookie name="source_id" expires=Now> <!--- Notice no quotes around Now --->
<cflocation url="somepage.cfm">

And on somepage.cfm you have
<cfoutput>#IsDefined("cookie.source_id")#</cfoutput> <!--- Always returns "YES" --->
0
 
LVL 11

Expert Comment

by:hart
ID: 10693576
yes tacobell is correct say for  eg: in a logout scenario, mostly what i do is

when the user clicks on logout,
say i rtake him to a page called logout.cfm

in which i write

<cfcookie name = "source_id"  value = ""  expires = "NOW">    

<script language="javascript">
function LogOut()
{
  window.location.replace("Default.cfm");
}
setTimeout("LogOut()",500);

</script>


and after this i take him to the default page after a timeout, this is just to make sure

else you can just write
<CFLOCATION URL=""Default.cfm" ADDTOKEN="No">

Regards
Hart

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

11 Experts available now in Live!

Get 1:1 Help Now