<html>
Hi Peter,<br>
<br>
Session variables auto-timeout. I am assuming that you want to
delete you session variables sometime BEFORE the timeout in
<CFAPPLICATION sesssiontimeout="X><br>
<br>
I have this problem with CLIENT variables, since they don't time out, and
I want the user to be logged out as soon as they close their
brower. Here is how I do it:<br>
<br>
I set a TEMPORARY cookie (one that is not written to hard disk)
somewhere on the site, usually on the logon page, depending on how you
want the site to work. Temporary cookies only reside in the memory
of the browse, and get deleted from the browser as soon as they close it.
If we <b>don't</b> set an EXPIRES value in <CFCOOKIE> then it is
not written to disk. Like this:<br>
<br>
<x-tab> </x-tab><CFCOOKIE
name="ONLINE" value="TRUE"><br>
<br>
If that cookie does not exist, then I clear the session with a command
like this in APPLICATION.CFM, or wherever it is appropriate to run:<br>
<br>
<x-tab> </x-tab><CFIF
Not IsDefined("Cookie.Online")><br>
<x-tab> </x-tab><x-tab> </x-tab><CFSET
temp=StructClear("session")><br>
<x-tab> </x-tab><x-tab> </x-tab><CFLOCATION
url="logon.cfm"><br>
<x-tab> </x-tab></cfif><br>
<br>
<br>
OR you could do it this way:<br>
<br>
<x-tab> </x-tab><CFIF
Not IsDefined("Cookie.Online")><br>
<x-tab> </x-tab><x-tab> </x-tab><CFLOOP
collection="Session" item="VarName"><br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><CFSET
Temp=StructDelete("session","#VarName#")><br>
<x-tab> </x-tab><x-tab> </x-tab></cfloop><br>
<x-tab> </x-tab><x-tab> </x-tab><CFLOCATION
url="logon.cfm"><br>
<x-tab> </x-tab></cfif><br>
<br>
NOTE: You MUST run this code pretty early in the global security process,
BEFORE you <CFPARAM> or <CFSET> your session variables,
because it destroys them.<br>
<br>
If you want your session variables still to exist, but just to be empty,
you could do it this way:<br>
<br>
<x-tab> </x-tab><CFIF
Not IsDefined("Cookie.Online")><br>
<x-tab> </x-tab><x-tab> </x-tab><CFLOOP
collection="Session" item="VarName"><br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab><CFSET
"Structure.#VarName#" = ""><br>
<x-tab> </x-tab><x-tab> </x-tab></cfloop><br>
<x-tab> </x-tab><x-tab> </x-tab><CFLOCATION
url="logon.cfm"><br>
<x-tab> </x-tab></cfif><br>
<br>
Sometimes my security code just looks for a single variable to be set, so
the user is logged out if that variable is false:<br>
<br>
<x-tab> </x-tab><CFIF
Not IsDefined("Cookie.Online")><br>
<x-tab> </x-tab><x-tab> </x-tab><CFSET
Session.UserAuth = FALSE><br>
<x-tab> </x-tab><x-tab> </x-tab><CFLOCATION
url="logon.cfm"><br>
<x-tab> </x-tab></cfif><br>
<br>
You get the idea....<br>
<br>
Douglas Smith<br>
<br>
At 12:50 PM 9/20/00 -0700, Peter Terhorst wrote:<br>
<blockquote type=cite cite>Sorry for the obvious and perhaps redundant
question:<br>
<br>
somewhere I've seen posted a method for deleting session variables when
the<br>
browser closes... can someone remind me of the technique or point me
to<br>
instructions on same?<br>
<br>
thanks,<br>
pts<br>
<br>
------------------------------------------------------------------------------<br>
To Unsubscribe visit
<a href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox"
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
</blockquote><br>
<br>
<font color="#008080">====================================================<br>
<b>Douglas M. Smith - Database Architect/Web Integration Specialist<br>
</b>====================================================<br>
</font><font face="Comic Sans MS" size=4 color="#FF0000">TeraTech Inc - Tools for
Programmers(tm)<br>
</font><font face="Comic Sans MS"><b>VisualBasic, Web (ColdFusion and ASP), Math and
Statistics, <br>
Access, SQL, programming tools & consulting<br>
</font><font color="#008080"><i>100 Park Ave, Suite 360, Rockville MD 20850 USA <br>
</i></b>Voice: 301-424-3903, Fax: 301-762-8185 <br>
<a href="http://www.teratech.com/" eudora="autourl">http://www.teratech.com</a><br>
====================================================<br>
Email: <b>[EMAIL PROTECTED]<br>
</b>Mobil/Cell Phone: (240) 601-5520<br>
ICQ: 41044319<br>
====================================================<br>
Do you need a group calendar or scheduler?<br>
How about a <b>free</b> ColdFusion Tag and Function Reference?<br>
Go to <a href="http://www.teratech.com/freestuff.cfm"
eudora="autourl">http://www.teratech.com/</a><a
href="http://www.teratech.com/freestuff.cfm" eudora="autourl"><b>freestuff.cfm</a><br>
</b>====================================================<br>
</font></html>
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.