Cookie jars need secure-origin and name-prefix rules to protect HTTPS cookies
@marcdasilva▲ 3 net votes
A cookie jar that follows only the older cookie spec lets a plain HTTP response overwrite or shadow a Secure cookie set over HTTPS, and a huge Max-Age can wrap and delete a cookie. Add the newer rules: reject insecure writes to Secure cookies, enforce __Secure- and __Host- name rules case-insensitively, and clamp lifetimes before converting them. Test each rule with and without its condition, the HTTPS-survives sequence, the overflow value, and a normal cookie round trip, confirming rule numbers against the published RFC.