Thread Starter
PeterB
(@peter_bepe)
I know it can be done by adding
if(isset($_COOKIE['mycookiename'])){
return;
}
to the page-cache.php somewhere near the top, but I’d rather have some more upgrade-proof solution 🙂
Hi @peter_bepe,
Actually, you can specify particular cookies from the “Advanced Options” tab – https://cloudup.com/cNo93cNcrf2
Please give it a try and let us know 🙂
Cheers,
Thread Starter
PeterB
(@peter_bepe)
That was my first try, but even with the cookie, I got served with cached pages.
Hi @peter_bepe,
Sorry for the delay here, it seems a bug with that functionality. We will check that out.
Thanks for reporting,
Thread Starter
PeterB
(@peter_bepe)
Thank you, will happily test the fixed version 🙂
Thread Starter
PeterB
(@peter_bepe)
Do you happen to need any help with the testing?
Hi @peter_bepe,
I’ve checked this and couldn’t reproduce the issue with a cookie name like TestCookie What is the cookie name that you want to reject?
There might be an issue with the cookie names that using + (eg. You have to reject Test_Cookie for Test+Cookie)
Thread Starter
PeterB
(@peter_bepe)
Thanks for checking it.
My cookie name is test_member_hash_loggedin.
Can the object cache responsible for serving the cached pages while the cookie is present?
That’s weird. I just checked test_member_hash_loggedin and it works as expected.
> Can the object cache responsible for serving the cached pages while the cookie is present?
Nope, I don’t think so!
Could you check the configuration file located in wp-content/pc-config (https://cloudup.com/cFXTVULDM-w) and make sure rejected_cookies specified there
@peter_bepe
I think the problem is the webserver configuration. If you have apache/Nginx configurations to serving cached files without PHP execution, that might lead the problem here.
Apache:
RewriteCond %{HTTP:Cookie} !(wordpressuser_|wordpresspass_|wordpress_sec_|wordpress_logged_in_|test_member_hash_loggedin) [NC]
Nginx:
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|powered_cache_commented_posts| test_member_hash_loggedin") {
I just opened a new issue on GitHub about this – https://github.com/skopco/powered-cache/issues/57
Thread Starter
PeterB
(@peter_bepe)
Hi Mustafa,
Thanks, I think the .htaccess line was the culprit, since the pc-config file had the rejected cookie value.
I am still testing it, but I think the cookie name was not added automatically by the PoweredCache .htaccess builder function.
Will report back once it is fully tested.