> I am using this code to delete my session variables when a 
> user closes their browser:
> 
>       <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>
> 
> The only problem is that it also deletes my client variables 
> upon closing the browser. Is there any way to just delete session 
> variables and leave the client intact??

Actually, this code doesn't delete Session or Client variables.

What it does delete is the link between an individual browser and the
variables on the server. Client and Session variables are associated with a
specific browser via those two cookies (assuming you're using cookies
instead of URL parameters, as you are).

As a result, you can't destroy the link to one without destroying the link
to the other. You could, however, work around this by doing your own state
management - set your own cookie on the browser, then retrieve data based on
the value of that cookie.

A better question for you, though, might be why you're using both Session
and Client variables - two ways of doing the same thing? That's probably not
the best approach.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

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

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to