Support » Plugin: W3 Total Cache » Logged in user not seeing logged in sidebar

  • Resolved demonboy

    (@demonboy)


    Hi,

    I have an identical problem to this post, in which my logged in users are being served up the non-logged in version of the sidebar, even though they are logged in.

    I am following the advice and attempting to add the

    <!-- mfunc mysecurestring -->

    suggestion, although I am struggling to work out how to add this to my bbpress sidebar (I’m using X theme).

    But that’s not my issue. My question is, if I prevent this login form from being cached, will this automatically serve up all ‘is-logged-in’ widgets? Once logged in the sidebar is the same (bbpress), but I have a number of conditions on my widgets to display or not display, depending upon whether they are logged in or not.

    I’m scratching my head over the best way to not cache anything when the user is logged in because I have set everything relevant within W3TC, yet my users (myself included) continually see cached pages once logged in.

    Any assistance is appreciated, thanks.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @demonboy

    Thank you for reaching out and I am happy to assist you with this.
    Once you exclude a specific part of the page from being cached with Page Fragment Caching, it only tells the W3TC not to cache the specific PHP code wrapped with <mfunc>, so this part of the page will stay dynamic and all conditions will remain the same.

    Regarding your other question, it’s simply not recommended to cache pages for logged-in users, to avoid sharing some sensitive data.
    The best way is to enable the option “Don’t cache pages for logged-in users” if this option is enabled, the option “Don’t cache pages for following user roles” should be disabled as it may create conflict.

    Can you please share the W3TC HTML snippet when logged in and when the option “Don’t cache pages for logged-in users” is enabled? As always, make sure that once the options are changed to save all settings and purge the cache.

    Thanks!

    Thread Starter demonboy

    (@demonboy)

    Hi Marko, thanks for the reply.

    I had set logged-in users to not have pages cached, but I had also set up specific user roles to be not cached. Perhaps that was the problem because, so far, I have not had any logged-in user tell me there was a caching issue. I’m hoping this alone has sorted the problem and therefore no need for fragment cache. Fingers crossed!

    Thanks once again.

    Thread Starter demonboy

    (@demonboy)

    OK, so I still have a problem. After the user has logged in they are taken to another page. If you then click back to the login page, it appears logged out again. If I have set ‘do not cache for logged in user’, why are they still seeing a logged out version of that page? Surely it will serve up the logged in version?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @demonboy

    Thank you for yoru feedback.
    Can you please share the screenshot of the Performance>Page Cache settings?
    Also, can you try disabling the Cache control header and expires header for HTML&XML in Performance>Browser Cache, save all settings and purge the cache and see if this helps!

    Thanks!

    Thread Starter demonboy

    (@demonboy)

    Hi Marko,

    I disabled Cache control header and expires header, but to no avail. Still serving up logged out page after clicking back to it.

    The screen shots of my Page Cache are here, here and here.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @demonboy

    Thank you for your feedback.
    I do not see the HTML snippet in the source. Can you please try adding the /ftbmates/ to Perofrmance>Page Cache>Never Cache following pages, and if Minify is enabled, add Performance to Performance>Minify>HTML&XML> Ignored comment stems:

    Let me know when it’s done so I can check the page and if the issue persists.
    Thanks!

    Thread Starter demonboy

    (@demonboy)

    Hi Marko,

    My apologies, I forgot to add that screenshot but I already had /ftbmates/ added to the ‘never cache the following pages’.

    I have, however, just added ‘Performance’ in the Performance->Minify->HTML&XML->Ignored Comment Stems, which now has three comment stems:

    google_ad_
    RSPEAK_
    Performance

    I’ve saved and purged all cache.

    Let me know your thoughts, thanks.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @demonboy

    Well, this is weird. As you can see from the HTML snippet the URL is excluded from the cache, meaning that this specific page is not cached at all by the W3TC.
    Page Caching using disk: enhanced (Requested URI is rejected)
    If possible Can you please disable the W3TC temporarily and see if the problem persists? If the issue is gone, re-enable the plugin and disable the settings in the Performance>General settings one by one, save all settings and purge the cache after each setting is disabled, and let me know which one may be causing the problem you are referring to.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hey @demonboy

    Any update on this?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.