Portal Home > Knowledgebase > Coldfusion > How do I delete a users session cookies when he closes the browser?


How do I delete a users session cookies when he closes the browser?




On ColdFusion pages, you can use the following code to delete a users session cookies when he closes the browser:

<!---Kill user session if user closes browser--->
<cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN")>
<cfset Variables.cfid_local = Cookie.CFID>
<cfset Variables.cftoken_local = Cookie.CFTOKEN>
<cfcookie name="CFID" value="#Variables.cfid_local#">
<cfcookie name="CFTOKEN" value="#Variables.cftoken_local#">
</cfif>



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

* ASP is only available on Windows

Home Page
About
Web Hosting
FAQ
Get Support
Script Downloads

Coldfusion Hosting
ASP Hosting
Linux Hosting
Railo Hosting

Terms of Service
Privacy Policy
Affiliate Program

* ASP is only available on Windows.