I was debugging an issue and the root cause was a cookie was being set with a "," in the value
Below was the origional code used:
setCookie(cookieName, {
sent: new Date().toUTCString(),
payload: payload,
updated: new Date().toUTCString()
});
This format, along with being a no-no, was ignored in Chrome and passed QA, but in Mac OS Safari is resulting in a cookie where the date is being split and assiging the value as it's own cookie
Exspected
cookieName Mon 08 Nov 2017 21:38:05GMT&nextValue=...
Actual
cookieName Mon
Mon 08 Nov 2017 21:38:05GMT&nextValue ...
I am since fixed the date format but I cannot seem to remove the bad cookie, which is causing issues.
Parsing the document.cookie into pair, I can get the name of the bad cookie
But if I try to remove using $.removeCookie('Mon 08 Nov 2017 21:38:05GMT&nextValue') I see the console log returns true, but yet, the cookie remains.
I have also tried setting to the cookie to null before delelting, but this created a new cookie with replaced spaces as "%20" $.cookie('Mon 08 Nov 2017 21:38:05GMT&nextValue', null)
Anyone have any suggestions for removed a rouge cookie which has spaced in the name? I have tried replacing with %20, to no avail.