?
Solved

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

Posted on 2004-03-26
5
Medium Priority
?
701 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
[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
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 375 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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

752 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