Closed (fixed)
Project:
Persistent Login
Version:
6.x-1.4
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2011 at 15:48 UTC
Updated:
23 Jun 2017 at 05:23 UTC
Jump to comment: Most recent
Comments
Comment #1
danepowell commentedHmm... I am using Varnish + Persistent Login (not Pressflow though). I noticed that PL was not working, and tried your fix, but it doesn't work- I am not logged back in automatically when I return to the site. Oddly, I am sometimes automatically logged in after visiting a second page on the site. Here is my VCL file, with your fix- can you help troubleshoot? I'm still a little green when it comes to Varnish.
Comment #2
drurian commentedI'm mostly using Lullabot's example from here, only modified to work with the single server. I just added Persistent login cookie to this line:
set req.http.Cookie = regsuball(req.http.Cookie, ";(SESS[a-z0-9]+|NO_CACHE)=", "; \1=");
I can send you my entire vcl if you want.
Comment #3
danepowell commentedAh, I think I've figured it out... it has to do with the cookie blacklisting vs whitelisting approaches that they discuss. What a useful article! I wish that had been around when I first set up Varnish... :)
Comment #4
drurian commentedI prefer Lullabot approach because it automatically removes all cookies unless specified.
Comment #5
danepowell commentedOkay, I solved that particular part of the issue- I too prefer the Lullabot approach now- but here's another issue that you are probably affected by, whether you realize it or not :) In order for Varnish to properly serve nodes (not just images, js, css, etc...), I've heard that you need to set page_cache_invoke_hooks = FALSE. However, if you do this, Persistent Login will not work, since it never has a chance to act.
Have you already considered this and found a way around it?
Comment #6
drurian commentedIs that a D7 issue? I don't have any D7 sites with Varnish right now.
On D6, I have this set to false and Persistent Login seems to be working
Comment #7
danepowell commentedIt is somewhat unique to D7. I don't know if it applies to D6 / Pressflow.
Comment #8
anavarreIs there any update on this issue ?
FYI, page_cache_invoke_hooks (in settings.php) only applies to D7 and allows for Varnish caching.
Comment #9
ptmkenny commentedI can confirm that Persistent Login (1.0-beta1) works on Pantheon (which has Varnish enabled by default). All you have to do is rename the cookie at /admin/config/system/persistent_login to SESSpersist or something similar (SESS+ lowercase string) as per Pantheon policies.
Comment #10
nwehner commentedI'm using the 7x branch on Pantheon and everyone works fine with that, too. The session cookie info for Pantheon's Varnish settings are at http://helpdesk.getpantheon.com/customer/portal/articles/425726 down at the bottom.
Comment #11
ptmkenny commentedComment #13
gappleI've added a note to the readme on adding the persistent login cookie to reverse proxy configuration
Comment #15
aaronbaumanThe link which explains Pantheon's cookie policy, and the "SESS" prefix is here:
https://pantheon.io/docs/caching-advanced-topics/
Edit: after testing, I can confirm that the "SESS" prefix *doesn't work* to fix this hole on Pantheon.
Comment #16
j.b commentedAny one know what is the config to be done for Drupal 8 ?
There is varnish cache on my server, and sometimes a cache version of pages are being served to my users.
When they refresh the page, they are login automatically.
For example as Admin, i check the remember me box and login.
I browse the website, and closes my browser.
I reopen my browser and visits the website. I am not login, if i access the admin page.
I am login automatically.
Isn't this a security risk ?
I'm using latest version of persistent login.