WordPress.org

Ready to get started?Download WordPress

Forums

Logout, cookie not set problem - SOLVED (3 posts)

  1. GreenDragon
    Member
    Posted 9 years ago #

    For those of you who are having problems when trying to logout, and being redirected to the admin page without the cookie values being cleared, the solution is to replace line 30 in wp-login.php : header("Location: wp-login.php");
    with this:
    if (strstr(php_uname(), 'Windows'))
    header("Refresh: 0;url=wp-login.php");
    else
    header("Location: wp-login.php");
    // End of IIS fix by Toby
    which is a fix that i've seen elsewhere (can't remember where exactly).
    The bug is caused not due to site path (at least, this specific bug), but due to the header Location: , which causes the web server to issue a 302, which then causes WordPress to generate a new url , but *without* the ?action=logout . i.e. the sequence is:
    WP -> wp-login.php?action=logout -> Server
    Server - > 302 -> WP
    WP - > wp-login.php -> Server

    hope you'll find the fix useful.

  2. djenyns
    Member
    Posted 9 years ago #

    It does not work for me. what did I do wrong:

    I put this:

    if (strstr(php_uname(), 'Windows'))
    header("Refresh: 0;url=wp-login.php");
    else
    header("Location: wp-login.php");

    then changed it to this:

    if (strstr(php_uname(), 'Windows'))
    header("Refresh: 0;url=wp-login.php");
    else
    header("Location: wp-login.php");
    // End of IIS fix by Toby

    When I click on the logout button, you just don't log out.

  3. djenyns
    Member
    Posted 9 years ago #

    help

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.