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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SessionManagement

Status
Not open for further replies.

barrylowe

Programmer
Nov 6, 2001
188
GB
I am trying to use session vaiables in my new site but keep getting this error message:

"Attempt to access a Session variable when session management is not enabled. Use the CFAPPLICATION tag to enable session management."

So I went to my Application.cfm file and added the line:

<cfapplication name=&quot;MyApp&quot; sessionmanagement=&quot;Yes&quot;>

Still no luck - can anyone help?
 
Try adding a session timeout property..

Something as basic as sessiontimeout=&quot;10&quot; will suffice for testing

Also.. CFLOCK your code where the error is occurring...

Something as simple as

<CFLOCK scope=&quot;session&quot; timeout=&quot;30&quot;>
...session interaction code...
</CFLOCK>

will suffice

if that helps, also read this faq I wrote for the forums: faq232-1926
 
webmigit,

is there anyway to destroy a session on the server on logout? Currently, if a user logouts the code simply nullifies all of their session variables. My boss wants me to instead destroy the variables to insure security and to free up memory on the server when someone logouts

Any suggestions
 
Code:
<CFLOCK timeout=&quot;10&quot; scope=&quot;session&quot;>
        <CFSET StructClear(Session)>
</CFLOCK>
will work better...
 
do I need to manually destroy each individual session variable

such as

structclear(#session.variable1#)
structclear(#session.variable2#)
or is there a way to tell the server to destroy all session
variables associated with a particular cftoken(which I am not carrying in the url but still resides in the user's browser in the form of a session cookie)
 
<CFLOCK timeout=&quot;10&quot; scope=&quot;session&quot;>
<CFSET StructClear(Session)>
</CFLOCK>

that should do it...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top