I'm setting a cookie using jquery.cookie. I can verify after setting that it's available in javascript with $.cookie("somecookie").
However when I do a window.location.href = "/somerelativeurl" the updated cookie is not sent to the server. (only the old version is sent.)
Since my code will do a redirect if the cookie isn't updated properly, I can also see the redirect request, and it has the cookie on it properly updated and everything.
What am I doing wrong?
It's probably a path problem.
Try to set cookie as follow:
$.cookie("somecookie", 1, { path : "/" });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With