I know that a cookie with secure
flag won't be sent via an unencrypted connection. I wonder how this works in-depth.
Who is responsible for determining whether the cookie will be sent or not?
I know that a cookie with secure
flag won't be sent via an unencrypted connection. I wonder how this works in-depth.
Who is responsible for determining whether the cookie will be sent or not?
The client sets this only for encrypted connections and this is defined in RFC 6265:
Just another word on the subject:
Omitting
secure
because your websiteexample.com
is fully https is not enough.If your user is explicitly reaching
http://example.com
, they will be redirected tohttps://example.com
but that's too late already; the first request contained the cookie.