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

Session Variable Not getting Killed(very urgent)

Status
Not open for further replies.

choudary

Programmer
Sep 3, 2000
19
ID
A session variable created for one user session is not getting killed even when the client browser is being closed,
the reason i found was its writing cookies to the cookies.txt file of folder TemporaryInternetFiles in windows machine. This actually do not happen in conventional session variables and the cookies will be killed once the browser is closed when we do not give expires attribute.

i am using the following code.

<cflock timeout=&quot;30&quot; name=&quot;#Session.SessionID#&quot; type=&quot;exclusive&quot;>

<cfset session.login = &quot;Yes&quot;>
<cfcookie name=&quot;CFID&quot; value=&quot;#session.CFID#&quot; expires=&quot;now&quot;>
<cfcookie name=&quot;CFTOKEN&quot; value=&quot;#session.CFTOKEN#&quot;>

</cflock>


it is working fine once i remove the cookies from the system

plese help me in this
[sig][/sig]
 
Try this...

<!-- Clear all session variables -->
<CFSCRIPT> StructClear(Session); </CFSCRIPT>
<CFCOOKIE NAME=&quot;CFID&quot; VALUE=&quot;0&quot; EXPIRES=&quot;NOW&quot;>
<CFCOOKIE NAME=&quot;CFTOKEN&quot; VALUE=&quot;0&quot; EXPIRES=&quot;NOW&quot;>


No need to thank me if it works. I found it somewhere on the net.


Klotzki [sig][/sig]
 
Oopps... i forgot a couple of things.

Insert the previous set of code in the logout page. And insert the following in your application.cfm

<!-- Set Sessions to expire when browser is closed -->
<CFCOOKIE NAME=&quot;CFID&quot; VALUE=&quot;#Session.CFID#&quot;>
<CFCOOKIE NAME=&quot;CFToken&quot; VALUE=&quot;#Session.CFToken#&quot;> [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top