Support » Plugin: My Private Site » Users trapped in a loop

  • i run a private travel blog for family and friends. This plugin allows me just to do that very easily. I have been using it over the last 5 years, never had an issue so far.

    EDIT : Some users were complaining they are not able to login to the site. I always thought it all boils down to a PEBKAC issue. However I found out that in some case the users can be trapped in a redirect loop.

    In your site menu add logout link to /wp-login.php?action=logout
    Once the user click it he is prompted if he really wants to disconnect.
    User confirms the disconnect and is redirected to login screen.
    If he tries to reconnect from there he’ll be redirected to the log out confirmation on and on…

    I wanted to fiel a support ticket, but the process is cumbersome since support moved away from WP forums. Looking for a replacement plugin.

    • This topic was modified 4 months, 2 weeks ago by geoffreymerck. Reason: found issue
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Geoffrey,

    I’ve had the same problem and found a solution that works for me. Perhaps you can try it. Just to be clear, the problem is this:

    When the landing page setting is set to “Return to same url” and you log out, you’re sent to the login page with the “return_to” URL parameter referencing the logout page, causing a login/logout loop when you do log back in.

    Unfortunately my solution requires an update to the source code, meaning it’ll likely be undone when the plugin is updated. However, it’s a one line change and could simply be bookmarked as an added step.

    FIX:

    1. ftp to the “includes” folder of the plugin:

    wp-content/plugins/jonradio-private-site/includes

    2. edit file public.php

    3. In function jr_ps_after_login_url(), change line 271 from

    if (strpos($_SERVER[‘REQUEST_URI’], ‘resetpass’) !== false) {

    to

    if (strpos($_SERVER[‘REQUEST_URI’], ‘resetpass’) !== false || strpos($_SERVER[‘REQUEST_URI’], ‘logout’) !== false) {

    This will cause the logout to redirect to the homepage first, which, due to the private site setting, will then redirect to the login page. This causes the “return_to” parameter in the URL to reference the home page instead of the logout page.

    Let me know if it worked.

    • This reply was modified 4 months, 1 week ago by bprael2.

    Hi,

    I appreciate you coming back to me on this issue. But I moved to another plugin with less features but perfectly fits my needs. As a bonus it also works with WP super Cache.

    Regards,
    Geoffrey

    I’d be interested to know which plugin you switched to. Hadn’t heard about super cache but would be very interested to try it.

    thx
    Brent

    Hi Brent,

    This is the one, it just does the job for me.
    https://fr.wordpress.org/plugins/wp-force-login/

    Plugin Author David Gewirtz

    (@dgewirtz)

    @geoffreymerck: I do wish you’d posted a support request in the ticketing system. It’s a great way for me to keep track of your specific issues, and I could have helped you. That said, I’m glad you found a viable alternative.

    @bprael2: That’s an interesting option. I’ve put it on my coding list to see if it’s something that can be added as a switchable option. Probably won’t be an immediate upgrade, but definitely stay tuned to the release notes to see if/when I get it in there.

    –David

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