CFLib.org – Common Function Library Project

SessionClear()

Last updated August 6, 2004

author

Robby Lansaw

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Allows you to 'structclear' an entire session without worrying about deleting ColdFusion's built in variables.

Return Values:
Returns nothing.

Example:

... populated session
<cfset sessionClear() />
... cleaned session

Parameters:

No arguments.

Full UDF Source:

/**
 * Allows you to 'structclear' an entire session without worrying about deleting ColdFusion's built in variables.
 * 
 * @return Returns nothing. 
 * @author Robby Lansaw (robby@ohsogooey.com) 
 * @version 1, August 6, 2004 
 */
function sessionClear(){
	var dont_clear = "sessionid,cfid,cftoken,jsessionid,urltoken";
	var key = "";
	for(key in session) {
		if(not listFindNoCase(dont_clear, key)) structDelete(session,key);
	}
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson