Problem/Motivation
Hi there. I currently use Drupal core's and Symfony's session cookies (via #1361742: Fix cookie conflicts on shared domains) and would like to start using this module instead, but the way that cookie prefixes are handled in this module means that we wouldn't be able to use the __Host cookie prefix because this module would prefix it with S in HTTPS, resulting in S__Host, which basically defeats the reason I'd want to customize the cookie prefix.
More information on cookie prefixes:
- https://scotthelme.co.uk/tough-cookies/#cookieprefixes
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#att...
Steps to reproduce
Set cookie prefix to __Host; log in via HTTPS; inspect cookies in dev tools; notice the cookie name starts with S__Host.
Proposed resolution
Instead of prefixing the configured prefix, add a suffix to the prefix for HTTPS, in between the configured prefix and the randomly generated part. Alternatively, given that HTTPS should arguably be the default for the web at this point in time, instead add the collision avoidance to any insecure (non-HTTPS) cookies and leave HTTPS cookie names alone.
Remaining tasks
See above.
User interface changes
Mostly just update form description.
API changes
None I think?
Data model changes
Unsure but probably none.
Issue fork persistent_login-3360187
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3360187-prefix-prefix
changes, plain diff MR !8
Comments
Comment #4
gappleLet me know if this MR works for you - it should preserve the prefix on the prefix, resulting in cookie names like
__Host-PL669af8b697a5f362dffd3f58410ac59eand__Host-SPL669af8b697a5f362dffd3f58410ac59eComment #5
ambient.impactAwesome work! Will check out once I have some time to spare.
Comment #6
ambient.impactI had a chance to try this out on a bare bones Drupal 10 site and I can confirm it works! Noticed a couple of unrelated issues so I'll open follow ups.
Comment #8
gapple