Logout not working

This topic contains 7 replies, has 3 voices, and was last updated by  Alex Howes 5 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #2315

    Alex Howes
    Buyer
    Post count: 175

    My logout page isn’t working. I’ve set it to the address http://barn-door.co.uk/wp-login.php?action=logout and it just redirects to my home page without logging out.

    Any help much appreciated!

    Thanks,
    Alex

    #2316

    Alex Rollin
    Moderator
    Post count: 27815

    UsersWP doesn’t have an option for setting logout page or link.

    WordPress has a nonce function for that link on my test site.

    Do you mean logout redirect?

    #2317

    Alex Howes
    Buyer
    Post count: 175

    Oh, sorry, ok. It must be a wordpress problem then. I’ll ask in the WordPress support forum.

    #2326

    Alex Howes
    Buyer
    Post count: 175

    In investigating this problem, I set the usersWP logout redirect page to another page, say the “about” page, to see what happened. The results were odd.

    If I try to logout when logged in, the logout page doesn’t logout and still redirects to the home page (rather than the “about” page I set it to).
    If I go to the logout page when logged out, I see the correct WP “are you sure you wish to logout?” page, and then it redirects correctly to the “about” page, as set in usersWP.

    Not sure whether this comes from a usersWP issue or not. Any ideas would be much appreciated!

    #2328

    Alex Rollin
    Moderator
    Post count: 27815

    What is the logout link you are clicking on, specifically on which page can we see it?

    #2329

    Alex Howes
    Buyer
    Post count: 175

    Thanks for your reply 🙂

    It’s a really weird problem- it’s now doing different things. Before the problem started I used the logout page https://www.barn-door.co.uk/logout which didn’t go to the WP “do you wish to logout page?” but did log the user out.

    When that stopped working I also tried creating a page with URL http://barn-door.co.uk/wp-login.php?action=logout.

    Sometimes https://www.barn-door.co.uk/logout works, but sometimes not. The other, http://barn-door.co.uk/wp-login.php?action=logout, either goes to the WP admin login page, or to the home page.

    Neither is currently redirecting to the “about” page set in usersWP, either for logged in or logged out users.

    #2344

    Patrik
    Moderator
    Post count: 1971

    Hi Alex,

    The logout page you are creating is wrong. Try adding the log out to menu from the Appearance-> Menus->Users WP->Logout and click on add to the menu. I have attached a screenshot for reference.

    Let me know if it works for you or not. If possible provide admin details in private reply and we will add it for you.

    Regards,
    Patrik

    #2349

    Alex Howes
    Buyer
    Post count: 175

    Hi Patrik,

    Sorry for bothering you with this- it turned out to be a WP problem rather than a usersWP problem. The issue stemmed from writing http: rather than https: in my logout link. The wp_safe_redirect in wp-login.php was treating this as an external page and hence either redirecting to WP admin login page, WP admin, or the home page, seemingly randomly. The problem is fixed now though.

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket