This plugins does not work fine with other plugins that use ‘wordpress’ word in their cookie names.
I had same problem as previously persons. Quick story:
2 browsers: FF(10) and IE(9), WP 3.3.1
FF open wp page, login and enable W3TC – (cache user logged in is disabled).
Open front page, other pages, posts – Page Caching using disk: enhanced (User is logged in) This is good.
Open IE, user is NOT logged in, cleared caches, open pages – Page Caching using disk: enhanced (User is logged in) WTF? User is NOT logged in.
Ok browsed google for answers found this topic. Strange – no solution.
Tried to see myself why W3TC thinks that user is logged in. Looked for code where it echoed that he thinks that user is logged in and found that cookie name is checked if it starts with ‘wordpress’ text. BTW – developers aren’t really smart and good – some code is repeated twice and this is not best practice example. Ok I left this as is.
Hmm next question – why W3TC founds cookie with ‘wordpress’ start in cookie names? Quick press F12 in IE and use developers tools. I found that Polylang plugin sets last used language in user cookie. Yes it’s good for Polylang users, but breaks W3TC.
Who to blame? If register Polylang issue, then maybe there are other plugins that also use ‘wordpress’ start string in their cookie names? I don’t want to find them all.
If W3TC could change cookie name checking – maybe this could solve the problem? Sounds good.
Examined WP cookies when user is logged in and not logged in. Found that special wordpress_logged_in_{hash} cookie exists at the same time with wordpress_{hash} cookie when user is logged in and they both are absent when user is logged off.
File: lib/W3/PgCache.php
748: if (strpos($cookie_name, ‘wordpress’) === 0) {
changed to
748: if (strpos($cookie_name, ‘wordpress_logged_in’) === 0) {
File: lib/W3/Db.php
614: if (strpos($cookie_name, ‘wordpress’) === 0) {
changed to
614: if (strpos($cookie_name, ‘wordpress_logged_in’) === 0) {
Tested again with FF and IE – now results are much better and functionality looks not broken.
Now developers should reject or accept this change.