Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: How to kill a coldfusion cookie??

$
0
0

I just got this to work in an older version of Coldfusion(5).  We will be migrating soon.  Does this work in your version?

<cfif IsDefined("Cookie.YourCookieName")>

    <cfcookie name="YourCookieName" value = "#Now()#" Expires="now" domain=".YourDomainName.com">

    <cfset delete_cookie=StructDelete(cookie,"YourCookieName")>

    <cfoutput>"Cookie is Gone"</cfoutput>

    <cfabort>

<cfelse>

    <cfcookie name="YourCookieName" value = "#Now()#" Expires="never" domain=".YourDomainName.com">

    <cfoutput>"Cookie exists"</cfoutput>

    <cfabort>   

</cfif>

 

I put this after <CFAPPlication> with

 

<cfapplication

        name = "YourAPPName"

        clientmanagement="yes"

        sessionmanagement="yes"

        setclientcookies="yes"

        sessiontimeout="#CreateTimeSpan(0, 0, 30, 0)#"

        applicationtimeout="#CreateTimeSpan(0, 0, 30, 0)#" clientstorage="Registry"

>

 

To test it, I reload the page.  It alternates between the "Cookie is Gone" and "Cookie exists".  Let me know if that works for you.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>