Forums

What logout link to put in sitebar? (9 posts)

  1. Okoth1
    Member
    Posted 3 years ago #

    I want to add the link logout at my sidebar menu.

    I have added (via Dashboard -> Links) the link 'Logout'. It used to work well when I used the link 'http://example.com/subfolder/wp-login.php?action=logout'. Not anymore since WordPress 2.7.
    'http://example.com/subfolder/wp-login.php' works fine to login.

    I am using a link widget (in my case BP Links+).

    Putting '">Logout' doesn't work here since I need to have a 'http://example.com/subfolder/....' link. At all others places at the website '">Logout' works well.

    What link do I need to use to make the logout work?

  2. Okoth1
    Member
    Posted 3 years ago #

    Since I can't edit my post, here is the one I intented to write:

    I want to add the link logout at my sidebar menu.

    I have added (via Dashboard -> Links) the link 'Logout'. It used to work well when I used the link 'http://example.com/subfolder/wp-login.php?action=logout'. Not anymore since WordPress 2.7.
    'http://example.com/subfolder/wp-login.php' works fine to login.

    I am using a link widget (in my case BP Links+).

    Putting <?php echo wp_logout_url(); ?> doesn't work here since I need to have a 'http://example.com/subfolder/....' link. At all others places at the website http://example.com/subfolder/wp-login.php works well.

    What link do I need to use to make the logout work?

  3. Okoth1
    Member
    Posted 3 years ago #

    Anyone?

  4. huotg01
    Member
    Posted 3 years ago #

    Do this work ?

    http://example.com/subfolder/wp-login.php?loggedout=true

    Gaston

  5. Okoth1
    Member
    Posted 3 years ago #

    No, this link doesn't do the actual logout. It just send me to the login page with the message that I have logged out.

    When I go back to the website and refresh with F5 I am still logged in...

    What could be another option?

  6. tiresias53
    Member
    Posted 3 years ago #

    I'd be very interested in the answer to this also. Is there in fact a solution now that wp_logout_url has been implemented?

  7. galuh82
    Member
    Posted 3 years ago #

    you can try this one :

    <a href='<?php echo wp_logout_url(); ?>'>Logout</a>

    or you can add redirect option to your homepage :

    <a href='<?php echo wp_logout_url(); ?>&redirect_to=/'>Logout</a>

    i hope this help :)

  8. Okoth1
    Member
    Posted 3 years ago #

    Sorry, it doesn't help. See the second post where I wrote: Putting <?php echo wp_logout_url(); ?> doesn't work here since I need to have a 'http://example.com/subfolder/....' link.

    Your solution doesn't start with http...

    Thanks for trying

  9. angelic007
    Member
    Posted 3 years ago #

    I have the same problem, too.

    The actual logout URL should be like

    http://www.domain.com/home/wp-login.php?action=logout&_wpnonce=0552b1e309

    , so the last part "wpnonce" seems to be missing calling wp_logout_url();

    Without it, the user SEEMS to be logged out, the redirect takes him (correctly?) to the login page, BUT the session is kept; if he go back to the site, for example opening a new tab, he will be still logged in.

    I'm using 2.7.1 and the function above.

    I didn't find a solution ...Anyone can help ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags