I don't think you CAN kill session variables just when a browser closes, since that's 
a client action and session variables live on the CF server.  Once CF serves up a 
page, it has no idea what's happening in the browser until another request comes from 
the browser.

Now you CAN kill all session vars by deleting their structure (see below) then 
deleting the cookies that contain the CFID/CFTOKEN that identify those session vars. 
The session vars you can kill after timing out; the cookies won't be deleted until the 
browser makes another request of the server.

And if you use non-persistent cookies (also called session cookies) then when ALL 
instances of the browser close then all the cookies are deleted.

Chris Norloff

<!--- delete the session (all vars, including CFID & CFTOKEN) --->
<cflock timeout="#variables.lock_timeout#" throwontimeout="Yes" scope="session" 
type="EXCLUSIVE">
        <cfset temp = #StructClear(session)#>
</cflock>

<!--- delete cookies --->
<cfcookie name="CFID" value="empty" expires="NOW">
<cfcookie name="CFTOKEN" value="empty" expires="NOW">

---------- Original Message ----------------------------------
from: "Haggerty, Mike" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Mon, 15 Jul 2002 14:39:17 -0400

>I am working on a project where it is essential all session variables are
>killed when the browser closes. 
>
>What starategies are others using to make this happen? what I am considering
>is a javascript solution that loads a new page when the window closes.
>Obviously, this is not bulletproof...
>
>M
>
>
>
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to