Whatever message this page gives is out now! Go check it out!

SessionInvalidate

Last update:
May 18, 2026

Description

Invalidates or cleans up the current session.
Note: The sessionInvalidate() method does not invalidate the underlying J2EE session.

Returns

None

Category

Display and formatting functions

Syntax

sessionInvalidate()

See also

History

ColdFusion 10: Added this function.

Parameters

None

Usage

Use this function to invalidate the existing session.

Example

Application.cfc
<cfcomponent> 
 <cfset this.sessionManagement = true /> 
 <cfset this.name = "session_app" /> 
 </cfcomponent>
sessionInvalidate.cfm
<cfif isDefined("url.invalidate") > 
 <cfset sessionInvalidate()/> 
 </cfif> 
 <cfif isDefined("url.name") > 
 <cfset session.name = url.name /> 
 </cfif> 
 <cfdump var="#session#" label="SESSION"> 
 <cfoutput> 
 <a href="sessionInvalidate.cfm?name=BOB">Set session.name = BOB </a> <br/> 
 <a href="sessionInvalidate.cfm?invalidate=TRUE">Invalidate the session</a> 
 </cfoutput>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page