@mattab opened this Issue on January 7th 2011 Member

on FF and Chrome at least, setting the cookie works, but deleting doesn't work. I looked but didn't see the solution (Piwik_Tracker_Cookie::setIgnoreCookie goes through ->delete() so not sure what is not working?)

@robocoder commented on January 10th 2011 Contributor

I'll take a look. It was working for me in FF when it was a separate plugin.

@mattab commented on January 10th 2011 Member

Using User Settings > Ignore Cookie, I can create but not delete the cookie.

Using ?module=CoreAdminHome&action=optOut I can opt out, opt in, then I can't opt out again (it just refreshes the page) with "You are currently opted in" message before/after.

The cookie is Name piwikignore
Value ignore%3DIioi%3A
%3D0120407fee2b696a29ce01e66e78aedfbd6a8ff6

@robocoder commented on January 10th 2011 Contributor

I think you're running into the "resend form?" problem because the browser thinks you're trying to re-POST.

Not sure what browser setting controls this, but I toggled it a dozen times.

What happens if you add this to optOut.tpl?

    <input type="hidden" name="fuzz" value="<?php echo time(); ?>"></input>
@mattab commented on January 10th 2011 Member

adding the line doesnt fix it

I cant remove the cookie also using the ' Click here to delete the cookie and have Piwik track your visits' link in Settings>User settings, which was working before (is it working for you?)

@robocoder commented on January 10th 2011 Contributor

(In [3692]) refs #1982 - Smarty default is to passthrough php tag as plain text; use built-in smarty.now

@robocoder commented on January 10th 2011 Contributor

Both UserSettings.setIgnoreCookie and CoreAdminHome.optOut worked for me.

See if [3692] helps in your case using optOut. I'm not sure about UserSettings. The only difference is that it's a GET, and there's a Location: (redirect) and Set-Cookie: in the response.

@robocoder commented on January 28th 2011 Contributor

(In [3815]) refs #1982 - delete() should use setCookie() instead of setcookie(), and pass path + domain.

@robocoder commented on January 28th 2011 Contributor

(In [3816]) refs #1919, refs #1929, refs #1982 - delete tracking cookie when opting out (i.e., ignore cookie is set)

@robocoder commented on January 28th 2011 Contributor

matt: please svn up and test

@mattab commented on February 5th 2011 Member

I tried, when I click delete the ignore cookie, I see the http response:

Set-Cookie piwik_ignore=deleted; expires=Fri, 05-Feb-2010 00:11:09 GMT

but then the following request still has the cookie.
Cookie piwikignore=ignore%3DczoxOiIqIjs%3D%3A%3D4b2ba04c6d8dccd6ff3b7837ab9278af4db04af4

I have the same problem with optout feature.

@robocoder commented on February 5th 2011 Contributor

Replying to matt:

I tried, when I click delete the ignore cookie, I see the http response:

Set-Cookie piwik_ignore=deleted; expires=Fri, 05-Feb-2010 00:11:09 GMT

I'm pretty sure that's the old code calling the built-in setcookie() function. Maybe there was a merge conflict with Cookie.php?

but then the following request still has the cookie.
Cookie piwikignore=ignore%3DczoxOiIqIjs%3D%3A%3D4b2ba04c6d8dccd6ff3b7837ab9278af4db04af4

I have the same problem with optout feature.

Another possibility is duplicate cookies in your browser. Did you previously install Piwik in a parent directory? (Cookies are uniquely identified by the tuple, (name, domain, path).

@robocoder commented on February 5th 2011 Contributor

(In [3853]) refs #1982 - when deleting cookie, mimic the built-in function

php/ext/standard/head.c has this comment:

  • MSIE doesn't delete a cookie when you set it to a null value so in order to force cookies to be deleted, even on MSIE, we pick an expiry date 1 year and 1 second in the past
@robocoder commented on February 5th 2011 Contributor

Delete the cookies manually in your browser and svn up. The http response in comment:11 shows that your working copy doesn't have the change from [3815].

@mattab commented on February 8th 2011 Member

OK Anthon you were right, my merge/update didn't complete for some reasons. Now all is working, great news.

This Issue was closed on February 8th 2011
Powered by GitHub Issue Mirror