> -----Original Message-----
> From: Moneymaker, Jon S (WPNSTA Yorktown)
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 12:08 PM
> To: CF-Talk
> Subject: Cookies and their expiration
> 
> 
> Still pretty new to all this, but am being asked some questions 
> by superiors
> about CF's use/creation of cookies....
>  
> CF (to maintain state) drops a "cookie" on the client that contains a cfid
> and cftoken....
>  
> Looking at the cookie (it's properties) in IE, (said superior noted with
> some surprise) that the expriation is, or appears to be 2037.
>  
> MY Question: is there a way to cause said cfid/token/cookie to 
> expire sooner
> (a lot sooner)?
>  
> I tried several things recommended in the books...but the cookie 
> remained on
> the browser....persistant little bugger that it is.
>  
> suggestions?


The old "kill cookies on browser close" routine works well:

<!--- In application.cfm --->
<cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN")>
  <cfset cfid_local = Cookie.CFID>
  <cfset cftoken_local = Cookie.CFTOKEN>
  <cfcookie name="CFID" value="#cfid_local#">
  <cfcookie name="CFTOKEN" value="#cftoken_local#">
</cfif>

This effectively sets "session cookies" -- cookies that expire when the user closer 
his or her browser, by omitting the EXPIRES attribute of the
CFCOOKIE tag.  In your situation, you would want to set an expiration date for the 
cookies, so you want to ADD the EXPIRES attribute to the above CFCOOKIE tags and put 
it in your application.cfm page(s).



- Andy


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to