Why can't I set cookies on localhost
I'm trying to set cookies on Safari, at localhost:8080 and localhost:80, but neither work.
Both of them work on chrome.
Safari version 16.3.
MacBook Pro 14″, macOS 13.2
I'm trying to set cookies on Safari, at localhost:8080 and localhost:80, but neither work.
Both of them work on chrome.
Safari version 16.3.
MacBook Pro 14″, macOS 13.2
Thanks for the reply,
Looked at some of those but not really my case.
In localhost:80 I'm using OctoberCMS (Laravel), and I don't even control the way it sets cookies, but am able to see it can't set any.
In Localhost:8080 I'm using Vue3, and VueCookieNext, and an example for a cookie set is:
VueCookieNext.setCookie('token', data.token)
Both are docker containers, but neither can set cookies in Safari, only in Chrome.
Still the same outcome with a valid hostname.
Kinda strange that it's only on Safari that this happens, that's why I came here and not OctoberCMS and Vue3 support.
Any other ideas?
Thank you in advance.
Does this help:
https://stackoverflow.com/questions/1134290/cookies-on-localhost-with-explicit-domain#1188145
including the comments to that reply, and the other replies.
Set a valid domain for the server, and make the whole problem go away.
Alternatively, check with the people supporting OctoberCMS and Vue3 about your particular usages.
Why can't I set cookies on localhost