Term
Max-Age
Meaning
The Max-Age attribute sets a cookie's lifetime as a number of seconds counted from the moment the browser receives it. Max-Age=3600 means one hour, and a value of zero or less removes the cookie immediately. Because it is relative, it avoids clock problems, and both RFC 6265 and MDN state that it takes precedence when Expires is also present. New code usually sets only Max-Age. To log a user out, a server sends the same name, domain and path again with Max-Age=0. See also: Expires, Persistent cookie, Cookie jar, the guide "Domain, Path, Expires and Max-Age Explained".