Archive

Posts Tagged ‘kill’

Kill session when browser closed

August 29, 2008 ppshein Leave a comment

Creating communication website, we gotta consider the security, the access and all uploaded data of our users. Now that if anyone want to upload their data into our communication websites, they must have each registered ID. So whenever they come and upload their data into our site, they need to login first and after uploading, they need to logout successfully. It’s ok that no problem without doing logout after uploading if anyone upload their data at their home pc. If Peter (for example) upload their data by using public internet cafe, it’s problem that they didn’t logout after uploading, someone can copy, delete and upload with Peter’s account into communication sites. So, we need to kill our users’ session data whenever they close their browsers after using it. But we cannot do anything if they didn’t logout or didn’t close browser after using.

Here is some coding we need to add in application.cfm

<cfif IsDefined( “Cookie.CFID” ) AND IsDefined(“Cookie.CFTOKEN” )>
<cfset localCFID = Cookie.CFID>
<cfset localCFTOKEN = Cookie.CFTOKEN>
<cfcookie name=”CFID” value=”#localCFID#”>
<cfcookie name=”CFTOKEN” value=”#localCFTOKEN#”>
</cfif>

Categories: coldfusion Tags: , , ,