views:

408

answers:

3

I am trying to delete the clientside session cookie when I access a certain page. How do I do this?

+1  A: 

Set the cookie again, with blank data and an expiry date of now.

<cfcookie name="cookie_name" value="" expires="now" />

It will remain for the rest of the request, and then it should go.

Peter Boughton
+9  A: 

Do you mean the CFID and CFTOKEN cookies? Or the Sessions struct? You can expire the cookies like this:

<cfcookie name="CFID" value="" expires="NOW" />
<cfcookie name="CFTOKEN" value="" expires="NOW" />

but if you want to clear the session scope you should do this:

<cfscript>
structClear(Session);
</cfscript>
ryber