Viewing 15 replies - 1 through 15 (of 16 total)
  • I use the following plugin to make sure users stay logged in: https://wordpress.org/plugins/wp-persistent-login/

    Maybe that will also help you.

    Thread Starter mhartste

    (@mhartste)

    Thanks for that suggestion, @joneiseman. I added that WordPress Persistent Login plugin and tried it, but still run into the problem.

    It seems that on certain pages my website thinks the user is logged out. The Events registration page, the Homepage, and the Login page seem to be the only ones affected. If I go to a different page it thinks I am logged in. So the Persistent Login plugin doesn’t do anything because the user still is logged in, just not on certain pages.

    It’s pretty weird.

    Mike

    Do you have any plugins that add caching? Is your hosting provider doing any caching server side?

    TreeTrail

    (@aprilschmitt27)

    @mhartste, we host with SiteGround and use their recommended, “Speed Optimizer” plugin. I have had to exclude the following URL’s from caching: /membership-account*, /about-wtc/wtc-membership/membership-levels*, /login/, and /wp-login.php?action=lostpassword/. Hope this helps.

    Thread Starter mhartste

    (@mhartste)

    @joneiseman

    Do you have any plugins that add caching? — No, I have no caching on my site, unless some plugin is doing it without letting me know.

    Is your hosting provider doing any caching server side? — No, I confirmed with my hosting provider, GoDaddy, that they don’t do any caching.

    Thanks for your good questions.

    Thread Starter mhartste

    (@mhartste)

    And I am using the Custom Login plugin to control the appearance of the login page, and PHP 8.1.

    I’m not sure that GoDaddy is really not using any caching. See the following thread: https://www.reddit.com/r/Wordpress/comments/zr53pp/godaddy_website_caching_issues/

    Thread Starter mhartste

    (@mhartste)

    Thanks, @joneiseman, for that pointer. That was useful.

    I just had a lengthy call with GoDaddy Support. GoDaddy believes this is an issue caused by one or more of my plugins, or a plugin conflict. They insist their environment is not causing the issue.

    They do have some caching, but I have almost no control over it. (I am running in their Managed WordPress product.) I did discover that if I add the ?nocache option to the URL then the page is correctly treated with me being logged in. So that confirms that it’s a caching issue. Now, if I could get the ?nocache option added to the URL on the page with the issue I might have some progress.

    Mike

    To always add ?nocache when visiting the homepage add the following to the .htaccess file:

    RewriteCond %{QUERY_STRING} !nocache
    RewriteRule ^$ /?nocache [R=302,L]
    Thread Starter mhartste

    (@mhartste)

    I added those lines to my .htaccess file but it didn’t add the ?nocache to the URL. I tried both before and after the # END WordPress line.

    And my .htaccess file just had some boiler plate text in it. Is that what it should be?

    But I’m not sure this would fix the issue. I’m using Plain permalinks for most of my pages, and the ?nocache works there. But for the event pages, the plugin automatically uses Pretty permalinks and that seems to be unable to go to the right page with the ?nocache string in it.

    Thanks!

    I tried adding the following to the top of the .htaccess file and it did add the ?nocache to the end of the url on the home page:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond ${QUERY_STRING} !nocache
    RewriteRule ^$ /?nocache [R=302,L]
    </IfModule>

    I think you should ask GoDaddy to help you with this caching problem.

    • This reply was modified 2 months, 1 week ago by joneiseman.
    Thread Starter mhartste

    (@mhartste)

    Ok, I added those additional lines, and now it adds the ?nocache to the homepage URL.

    But it fails to load with this error:

    This page isn’t working

    <mytestsite> redirected you too many times.

    ERR_TOO_MANY_REDIRECTS

    Try the following instead to add ?nocache to all pages (or &nocache if there are already query parameters).

    <IfModule mod_rewrite.c>
    RewriteEngine On

    # Check if my_parameter already exists in the query string
    RewriteCond %{QUERY_STRING} !(^|&)nocache [NC]

    # If it doesn't exist and there is no query string, add it with ?
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^(.*)$ $1?nocache [L,QSA]

    # If it doesn't exist and there is a query string, add it with &
    RewriteCond %{QUERY_STRING} !^$
    RewriteRule ^(.*)$ $1&nocache [L,QSA]
    </IfModule>
    • This reply was modified 2 months, 1 week ago by joneiseman. Reason: handle case with existing query parameters
    • This reply was modified 2 months, 1 week ago by joneiseman. Reason: avoid duplicating the query parameter
    Thread Starter mhartste

    (@mhartste)

    That didn’t work.

    When I go to the homepage, there is no ?nocache option.

    When I go to any other page I get an error:

    ==========

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    ==========

    But, the good news is that if I add &nocache to the event page URL it seems to work.

    Thanks.

    Instead of using the nocache query parameter follow the instructions here: https://www.godaddy.com/help/cache-exceptions-41618

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