Coldfusion Session Cookie

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

Upvotes: 3

Views: 3714

Answers (3)

ryber
ryber

Reputation: 4555

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>

Upvotes: 11

Peter Boughton
Peter Boughton

Reputation: 112150

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.

Upvotes: 1

Related Questions