Skip to content

Instantly share code, notes, and snippets.

@misterdai
Created July 1, 2010 12:22
Show Gist options
  • Save misterdai/459885 to your computer and use it in GitHub Desktop.
Save misterdai/459885 to your computer and use it in GitHub Desktop.
Stops a Coldfusion session
<cffunction name="sessionStop" output="false">
<cfset var local = StructNew() />
<cfif Not StructKeyExists(application, 'applicationName')>
<cfthrow message="Application.applicationName is missing." />
</cfif>
<cftry>
<cfset local.sid = session.cfid & '_' & session.cftoken />
<cfset local.jTracker = CreateObject('java', 'coldfusion.runtime.SessionTracker') />
<cfset local.jTracker.cleanUp(application.applicationName, local.sid) />
<cfcatch type="any">
<cfthrow message="Error stopping session, may not exist." />
</cfcatch>
</cftry>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment