This is what I use:

        <CFPARAM name="attributes.setSessions"
default="username,password,userID">
        <CFIF NOT StructISEmpty(SESSION)> 
                <CFSET keysToStruct = StructKeyList(SESSION,",")>
                <!--- Kill SESSION Variables --->
                <CFLOOP INDEX="ListElement" LIST="#keysToStruct#">
                
                        <CFIF
ListContainsNoCase(attributes.setSessions,ListElement,",")>
                                <CFSET
tmp=#StructDelete(SESSION,"#ListElement#",TRUE)#>
                        </CFIF>                                         
                        
                </CFLOOP>
                <!--- Kill SESSION Variables --->
        </CFIF>

That destroys all specified session variables in a list but you could
easily change it to delete them all by just eliminating the <CFIF
ListContainsNoCase()></CFIF> method.



Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-9044 ext. 254
 
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of 
Garrison Enterprises Inc.
 
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you 
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************


-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 30, 2002 6:59 PM
To: CF-Talk
Subject: Delete all Session Vars on Logout..


When a client logs out of a particular application, I have the need to
destroy all session variables, cookies....everything....

What's the best and most secure way to accomplish this?

Can I simply put something like:

        <cfset tempvariable = StructClear(session)>
        <cflocation url="YouIsLoggedOut.cfm">

.on the "logout" processing page?

What's "best practice" for this?

Thanks,

Les


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to