Skip to main content
Jan 5, 2012 7:42 PM UTC
Question

Strange cookie issue(s)

I posted a long time ago about why cfcookie was not working well in IE.  What was happening was that no matter what I did (expires="now", structdelete, cflogout) the cookies persisted on the local machine and could not be deleted.  It only happened in IE.  We decided the problem was related to the domain http://mydomain.com vs. http://www.mydomain.com.  Since then I've done a 301 redirect so that the www. prefix will be appended to all pages and the cookie problem is still occurring.

The question is, what is the most effective way of permanently deleting a cookie using coldfusion 9???  Please don't use expires="now", structdelete, or cflogout as an answer because none of those work.

Thanks!

This topic is closed to new replies. Start a new post to keep the conversation going.

9 replies

Community Expert
Jan 5, 2012 7:53 PM UTC

The question is, what is the most effective way of permanently deleting a cookie using coldfusion 9???  Please don't use expires="now", structdelete, or cflogout as an answer because none of those work.

Really? Setting the EXPIRES attribute has always worked for me. So, I suspect something else is happening than what you think.

Dave Watts, CTO, Fig Leaf Software

Translate
Dave Watts, Eidolon LLC
Jan 5, 2012 7:57 PM UTC

That isn't helping much.

Here's a good example....

I run a .cfm page that has the following code.  My cookie named site_username was: billygoat

---------------------------

<cflogout>

<cfcookie name="site_username" expires="NOW">

<cfset delete_username=StructDelete(cookie,"site_username")>

---------------------------

The result?  billygoat

Translate
12Robots
Participating Frequently
Jan 5, 2012 8:07 PM UTC

Did you check the HTTP response from that request to see if a new SET-COOKIE was being sent?  I am unsure of the result of deleting the key formt he cookie struct after you set the cookie?  Will it even be sent at all?  And what is the point of deleting the key for that matter?  Delete the third line of your example code and try it again.

Jason

Translate