Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I remove a seesion variable

Status
Not open for further replies.

Markh51

Programmer
May 20, 2003
81
GB
How do I remove a seesion variable completly.

Not just:

<CFSET session.variable = &quot;&quot;>

I need to make it as though it had never been set.

Any Ideas ???

Mark
 
Sessions are in a structure called &quot;session&quot; so you can remove the variable from the structure with built in structure functions.

<cfset structDelete(session, &quot;yourSessionVariable&quot;)>
will clear your session variable.

likewise, if you want to get rid of all of them,
<cfset structClear(session)>

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
Just a thought, but it is recomended by macromedia (at least for 5.0) to only use structDelete(session,&quot;var&quot;) for session variables.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top