I have application on my localhost in https. But the certification on localhost is broken.
Below, response header. Problem: MyCookie is not created:
MyCookie=MyValue;Path=/;Domain=localhost;Secure; HttpOnly
But for this header. The cookie is created:
MyCookie=MyValue;Path=/;Secure; HttpOnly
Is there any Chrome politics which disallow create cookie for broken https page which set domain in the header?
Secure cookies are set only on HTTPS, but not on http://localhost for all browsers. And because SameSite:none and __Host also require the cookie to be Secure , setting such cookies on your local development site requires HTTPS as well.
SameSite=None requires Secure The warning appears because any cookie that requests SameSite=None but is not marked Secure will be rejected. To fix this, you will have to add the Secure attribute to your SameSite=None cookies. A Secure cookie is only sent to the server with an encrypted request over the HTTPS protocol.
Explicit setting domain cookie on localhost doesn't work for chrome.
From this:
You can only set domain cookies for registry controlled domains, i.e. something ending in .com or so, but not IPs or intranet hostnames like localhost
Try to set
cookie_domain = ""
By this the cookie can be created and will work.
I've tried it and it was working fine.
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