Why does my SameSite=None cookie not work?
Because SameSite=None requires the Secure flag alongside it; without it, the browser rejects the cookie entirely instead of merely restricting its use, and this shows no visible error, the cookie simply never gets saved.
What is the difference between the __Host- and __Secure- cookie prefixes?
__Secure- only requires the Secure flag on the cookie; __Host- is stricter and requires Secure, Path=/ and the complete absence of a Domain attribute, which prevents the cookie from being shared with subdomains.
What is the maximum size of a cookie?
4096 bytes counting only the name and value (name=value); attributes like Secure, Path and Expires do not count toward that limit, but the browser rejects the entire cookie if name=value goes over it.
Do session cookies last forever if I never set Expires?
No. Without Expires or Max-Age, the cookie is a session cookie and disappears when the browser closes; if you set a very long Max-Age, Chrome automatically truncates it to 400 days from creation, but Firefox and Safari do not enforce that cap yet.