Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion source/content/cookies.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {

## Cache-Varying Cookies

Respond to a request with cached content depending on the presence and value of a particular cookie. It's important to note that in order for the response to be cached by Pantheon's Edge, the cookie name must match `STYXKEY[a-zA-Z0-9_-]+`.
Respond to a request with cached content depending on the presence and value of a particular cookie. It's important to note that in order for the response to be cached by Pantheon's Edge, the cookie name must follow these naming rules:
* Must begin with the 7 capital letters `STYXKEY`
* Must have one or more of the following:
* letters `a-z` and `A-Z`
* numbers `0-9`
* underscore `_`
* hyphen `-`

If you prefer a regular expression, the name must match the following format: `STYXKEY[a-zA-Z0-9_-]+`. Test your cookie with [Regex 101.](https://regex101.com/)

First, check to see if the cookie is set within the incoming request. If the cookie is set, store the value and use it to generate varied content as appropriate for your use case and implementation.

Expand Down