Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NemoZon authored Jan 16, 2025
1 parent 63b1a25 commit 842346f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To minimize the scope for cookie vulnerabilities on your site, limit access to c
- `HttpOnly`
- : Cookies that don't require access from JavaScript should have the `HttpOnly` directive set to block access, such as from {{domxref("Document.cookie")}}. It is particularly important that session identifiers don't have JavaScript access, to help prevent attacks such as CSRF.
- `Expires` and `Max-Age`
- : Cookies should expire as soon as they are no longer needed. Session identifiers in particular should expire as quickly as possible. `Expires` is preferred unless you need to support IE < 8, in which case use `Max-Age`.
- : Cookies should expire as soon as they are no longer needed. Session identifiers in particular should expire as quickly as possible.
- `Expires`: Sets an absolute expiration date for a given cookie.
- `Max-Age`: Sets a relative expiration date for a given cookie.
> **Note:** `Expires` has been available for longer than `Max-Age`; however, `Max-Age` is less error-prone, and takes precedence when both are set. The rationale behind this is that when you set an `Expires` date and time, they're relative to the client on which the cookie is being set. If the server is set to a different time, this could cause errors.
Expand Down

0 comments on commit 842346f

Please sign in to comment.