<html>
Hi Peter,<br>
<br>
Session variables auto-timeout.&nbsp; I am assuming that you want to
delete you session variables sometime BEFORE the timeout in
&lt;CFAPPLICATION sesssiontimeout=&quot;X&gt;<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.&nbsp; Here is how I do it:<br>
<br>
I set a TEMPORARY cookie (one that is not written to&nbsp; hard disk)
somewhere on the site, usually on the logon page, depending on how you
want the site to work.&nbsp; 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 &lt;CFCOOKIE&gt; then it is
not written to disk.&nbsp; Like this:<br>
<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFCOOKIE
name=&quot;ONLINE&quot; value=&quot;TRUE&quot;&gt;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFIF
Not IsDefined(&quot;Cookie.Online&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFSET
temp=StructClear(&quot;session&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOCATION&nbsp;
url=&quot;logon.cfm&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfif&gt;<br>
<br>
<br>
OR you could&nbsp; do it this way:<br>
<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFIF
Not IsDefined(&quot;Cookie.Online&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOOP
collection=&quot;Session&quot; item=&quot;VarName&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFSET
Temp=StructDelete(&quot;session&quot;,&quot;#VarName#&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfloop&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOCATION&nbsp;
url=&quot;logon.cfm&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfif&gt;<br>
<br>
NOTE: You MUST run this code pretty early in the global security process,
BEFORE you &lt;CFPARAM&gt; or &lt;CFSET&gt; your session&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFIF
Not IsDefined(&quot;Cookie.Online&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOOP
collection=&quot;Session&quot; item=&quot;VarName&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFSET
&quot;Structure.#VarName#&quot; = &quot;&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfloop&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOCATION&nbsp;
url=&quot;logon.cfm&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfif&gt;<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFIF
Not IsDefined(&quot;Cookie.Online&quot;)&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFSET
Session.UserAuth = FALSE&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOCATION&nbsp;
url=&quot;logon.cfm&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfif&gt;<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&amp;body=lists/fusebox" 
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;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 &amp; 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.

Reply via email to