You can specify a session variable's timeout in the <CFAPPLICATION> tag (in
fact, you MUST set it).  Session variables can last as long as you want them
to, but bear in mind that they typically reside in memory, so be judicious
about their usage!  As for terminating the session, you can use the
StructClear() function.

--
Jamie Keane
Programmer
SolutionMasters, Inc.
9111 Monroe Rd., Suite 100
Charlotte, NC  28270
www.solutionmasters.com
704.563.5559 x 228  Voice
704.849.9291  Fax
-----Original Message-----
From: megan sherman <[EMAIL PROTECTED]>
To: cold fusion <[EMAIL PROTECTED]>
Date: Friday, September 01, 2000 3:38 AM
Subject: New and Worried (terminating a session)


>Hi all,
>This is proving to be an informative list! I have worked out a lot of
>the cold fusion portion of my latest site. Session variables are still a
>mystery. How do I turn off a session? In other words, if I leave the
>website and come back in an hour, or next day, I want a fresh session.
>Can this be done in applications.cfm with a timer/counter? I think I
>read somewhere that a session can be terminated with javascript.
>Earlier, someone posted the cold fusion script below. Will that
>terminate my session after 30 minutes (or do I have to modify this code
>somewhat?) Any help would be greatly appreciated. BTW, what is the
>philosphy of a "session"? Do customers expect their session to be
>persistant over days?
>Thanks!
>Megan
>
>
>I use this which deletes all client variables if they haven't been
>accessed in 30 minutes:
>
><CFIF not isDefined('client.initialize_session')>
><cfset client.initialize_session = now()>
><cfelse>
><cfset app_timeout = now() - createtimespan(0,0,30,0)>
>     <CFIF client.initialize_session GTE app_timeout>
>     <cfset client.initialize_session = now()>
>     <CFELSE>
>     <cfset clientlist = GetClientVariablesList()>
>         <cfloop index="i" list="#clientlist#">
>            <cfset temp = DeleteClientVariable('#i#')>
>         </cfloop>
>         <cfset client.initialize_session = now()>
>     </CFIF>
></CFIF>
>
>---------------------------------------------------------------------------
---
>Archives: http://www.mail-archive.com/[email protected]/
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to