Using Drupal 8 Persistent Login Module on Platform.sh
The Persistent Login module relies an extra cookie to maintain a Drupal user’s session. The configuration screen for this module lets you specify a prefix for the cookie. The default is “PL”. If you are using the site on HTTPS, the module prepends an “S” to the cookie it creates. Here’s an example cookie name:
SPLfa0650d6d985433d455a3b15cc70fd9b .
Platform.sh lets you configure cookie cache settings via
routes.yaml .
If you’re using Persistent Login you must tell the system not to ignore this cookie.
Here’s a standard (and simple)
routes.yaml file on a Drupal 8 site:
1 2 3 4 5 6 7 8 |
"https://{all}/": type: upstream upstream: "app:http" cache: enabled: true # Base the cache on the session cookie. # Ignore all other cookies. cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] |
1 2 3 4 5 6 7 8 |
"https://{all}/": type: upstream upstream: "app:http" cache: enabled: true # Base the cache on the session cookie and persistent login cookie. # Ignore all other cookies. cookies: ['/^SS?ESS/', '/^S?PL/', '/^Drupal.visitor/'] |
There is a bit more discussion around how these cookies are handled here: https://www.drupal.org/node/2898065/discuss