Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close a session on browser close?

Status
Not open for further replies.

zootweller

Technical User
Oct 7, 2001
46
GB
I have the following application.cfm template, but wish to modify it so when a user closes the browser the session closes with it - any suggestions?

<CFAPPLICATION NAME=&quot;HelplineLogin&quot; SESSIONMANAGEMENT=&quot;YES&quot;
SESSIONTIMEOUT=&quot;#CreateTimeSpan(0,0,30,0)#&quot;
APPLICATIONTIMEOUT=&quot;#CreateTimeSpan(0,0,30,0)#&quot;>

<CFPARAM NAME=&quot;session.LoggedIn&quot; DEFAULT=&quot;FALSE&quot;>

<CFIF #session.LoggedIn# IS &quot;FALSE&quot;>
<CFIF (CGI.SCRIPT_NAME IS NOT &quot;/Helpline_Admin/Admin_Login.cfm&quot;)
AND (CGI.SCRIPT_NAME IS NOT &quot;/Helpline_Admin/Admin_Login_Results.cfm&quot;)>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
alert(&quot;You are about to be asked for your details.&quot;);
self.location='Admin_Login.cfm';
</SCRIPT>
</CFIF>
<CFELSE>
</CFIF>
 
<!--- ADD THIS CODE IN APPLICATION.CFM OR ON TOP OF EVERY PAGE--->
<cfif isdefined(&quot;cookie.cftoken&quot;) AND isdefined(&quot;cookie.cfID&quot;)>
<cfset cookieid=cookie.cfid>
<cfset cookietoken=cookie.cftoken>
<cfcookie name=&quot;CFTOKEN&quot; value=&quot;#cookietoken#&quot;>
<cfcookie name=&quot;CFID&quot; value=&quot;#cookieid#&quot;>
 
Thanks for that, maybe I should have rtfm and I would have known! Much appriciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top