How can you kill the session when the browser is closed, or
the user leaves your site?
(In ASP, the session ends when you close the browser)
I've looked at the Allaire developers exchange and a number
of people had the same question, but nobody had responded with
an answer.
You can
Put this in your application.cfm:
!---If user closes browser end session ---
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
!---Kill Session on Browser Close---
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
"David Berger" [EMAIL
Thanks for the code Alex
Where does this code go?
From: Alex [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date: Thu, 22 Feb 2001 12:31:38 CST
To: CF-Talk [EMAIL PROTECTED]
Subject: Re: [End session on browser close]
!---Kill Session on Browser Close---
cfif IsDefined
application.cfm
Nick Texidor [EMAIL PROTECTED] wrote:
Thanks for the code Alex
Where does this code go?
From: Alex [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date: Thu, 22 Feb 2001 12:31:38 CST
To: CF-Talk [EMAIL PROTECTED]
Subject: Re: [End session on browser close]
!---Kill
I'm a bit confused by what this piece of code is supposed to do. Looks
to me like you reassign cookie values to themselves. Not sure how that
solves the problem.
--
Billy Cravens
HR Web Development, Sabre
[EMAIL PROTECTED]
Alex wrote:
!---Kill Session on Browser Close---
cfif
2001 6:21 PM
Subject: Re: [End session on browser close]
I'm a bit confused by what this piece of code is supposed to do. Looks
to me like you reassign cookie values to themselves. Not sure how that
solves the problem.
--
Billy Cravens
HR Web Development, Sabre
[EMAIL PROTECTED]
Al
]]
Sent: 23 February 2001 10:21
To: CF-Talk
Subject: Re: [End session on browser close]
I'm a bit confused by what this piece of code is supposed to do. Looks
to me like you reassign cookie values to themselves. Not sure how that
solves the problem.
--
Billy Cravens
HR Web Development, Sabre
8 matches
Mail list logo