From 3e52aac5d241b5aa10c50a88d29f9baca4e56554 Mon Sep 17 00:00:00 2001 From: Conor Bauer <58449847+conorbauer23@users.noreply.github.com> Date: Fri, 15 Jul 2022 10:50:14 -0400 Subject: [PATCH 1/2] Update cookies.md for clearer regex explanation --- source/content/cookies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/content/cookies.md b/source/content/cookies.md index 40d78950e1..a3bf5f6b9e 100644 --- a/source/content/cookies.md +++ b/source/content/cookies.md @@ -57,7 +57,7 @@ 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 match the following regular expression format: `STYXKEY[a-zA-Z0-9_-]+`. To make sure the cookie in question matches `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. From 473f5feb280007d8058d47b053bd84e3d3683063 Mon Sep 17 00:00:00 2001 From: Conor Bauer <58449847+conorbauer23@users.noreply.github.com> Date: Fri, 15 Jul 2022 14:58:14 -0400 Subject: [PATCH 2/2] Update source/content/cookies.md Co-authored-by: Ryan Marks --- source/content/cookies.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/content/cookies.md b/source/content/cookies.md index a3bf5f6b9e..6e3d120c26 100644 --- a/source/content/cookies.md +++ b/source/content/cookies.md @@ -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 the following regular expression format: `STYXKEY[a-zA-Z0-9_-]+`. To make sure the cookie in question matches `STYXKEY[a-zA-Z0-9_-]+`, test your cookie with [Regex 101.](https://regex101.com/) +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.