> I've found that cf session variables get dumped *in
> theory* on browser exit.

No, they do not. They are not supposed to be, either.

> I then encountered this bit of code which solved the same
> problem that I was having:
>
> <!--- code to force session end on browser close --->
> <cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN")>
>   <cfset localCFID = Cookie.CFID>
>   <cfset localCFTOKEN = Cookie.CFTOKEN>
>   <cfcookie name="CFID" value="#localCFID#">
>   <cfcookie name="CFTOKEN" value="#localCFTOKEN#">
> </cfif>
>
> Not *exactly* sure why it works, but it does /shrug

It works because it writes the cookies as non-persistent cookies. By
default, CF writes CFID and CFTOKEN as persistent cookies. However, it's
worth pointing out that your code rewrites the cookies on every page
request, which is more work than is required (and kind of annoying to people
who've enabled cookie notification, I suppose!) Instead, you can write them
once using the code I posted in another message a few minutes ago.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to