I am using a session variable to store who is logged into the system, the problem is that when Explorer is closed and re-opened, the session variable is still holding the value.
if you CFPPLICATION tag has got the setclientcookies=yes then the session will not expire until the timeout specified in the cfapplication passes. at this point the session will timeout and the user will have to log back into your system again.
a way of deleteing a session before it timesout is to use this:
<CFSCRIPT>
StructClear(#Session#);
</CFSCRIPT>
in a cflock of course. this will clear the session structure, and mean the user has to log in again !
Will struct clear actually destroy the session variable(s)?
Currently, on our site, when a user logs out their session variables are nullified. But now my superiors want the session to actually be destroyed on the server, on logout
To insure security as well as free up memory.
Is there anyway to do this or something close to it?
This will change the cfid and cftoken to "session" cookies, which will be deleted from the user's computer when they close their browser. If they don't log out beforehand, it won't matter, since their session won't be valid when they come back.
Note, this method will not delete the session variables that are associated with the cfid and cftoken from the memory of the server; it will only delete the cookies from the user's browser when it is closed; their session will time out when whatever timeout value is reached for sessions, depending on whether you are setting it in application.cfm or in the CF administrator.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.