WordPress.org

Ready to get started?Download WordPress

Forums

Upgrade to 2.7; Login reloads login page (35 posts)

  1. sim2008
    Member
    Posted 5 years ago #

    Hi,

    @WP Administration folks! Please help!

    The following two posts are very similar to the issue I'm experiencing but there seems to be no resolve, so I figured I'd open a new post with more details, to get the attention of someone who could possibly fix the problem, as I'm without a very important blog 4 days counting;

    http://wordpress.org/support/topic/226559 (post by: Digg50)
    http://wordpress.org/support/topic/224318 (post by: guioconnor)

    My setup:

    Hosted by 1and1.co.uk, using MySQL5.0, upgrading from 2.6.5 ==> 2.7

    Problem:

    After upgrading from 2.6.5 ==> 2.7 successfully which is what it WP told me, I'm left with a login page that reloads each time I enter the correct username and password. And gives me error messages when enter incorrect username or password.

    I go to http://www.xxx.com/wp-admin (or wp-login), enter my login credentials and the page reloads with the following url now:

    http://www.xxx.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.xxx.com%2Fwp-admin%2F

    And as I mentioned I get the same login page, no errors, nothing.

    What I have tried before this post:

    I've almost reached the end of going through every single post related to the similar issues with no luck and kind of lost as to where I go from here. In summary I've done the following;

    Clearing cache, cookies, disabling firewall, different computers, different browsers, removing my plugins folder and replacing it with just a empty plugins folder, and updating and making sure my config files are correct and checking my DB urls as this site explains http://www.tamba2.org.uk/wordpress/site-url/ all with no luck.

    I don't know to much about cookies but guessing that its related to this, but don't know how to fix it; using the Firefox Web Developer Toolbar, I found the following results if these are any use to anyone who may be able to resolve this problem;

    The authentication cookie is being set in the response after sending the initial login request which appears to work, but is not being sent back in the subsequent request.

    I tried setting the cookies manually (the ones provided in the response header) using web developer toolbar and reloading the admin page. Doing this gave me the 'Please log in again.' message which we had not been previously seeing, but had been posted about in the WP forum.

    Can anyone help knowing this information? WP folks, please chime in as I have been through a lot of forum posts and not had much luck.

    Thanks all.

  2. Niteblade
    Member
    Posted 5 years ago #

    Do some tests and see if the variable ABSPATH is being defined correctly.

    echo ABSPATH;

    In particular, add that in /wp-admin/admin.php before the call to /wp-admin/includes/admin.php . If ABSPATH is NOT defined before the call to /wp-admin/includes/admin.php, your dashboard will not load.

  3. ohohdon
    Member
    Posted 5 years ago #

    Here is the code from admin.php:

    define('WP_ADMIN', TRUE);

    if ( defined('ABSPATH') )
    require_once(ABSPATH . 'wp-load.php');
    else
    require_once('../wp-load.php');

    if ( get_option('db_version') != $wp_db_version ) {
    wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    exit;
    }

    require_once(ABSPATH . 'wp-admin/includes/admin.php');

    I'm not a programmer and don't understand any of the code. I tried adding "echo ABSPATH;" before the last line of code and my login still failed. Any other ideas?

  4. Digg50
    Member
    Posted 5 years ago #

    Niteblade - Digg50 here I tried adding echo ABSPATH I think as you suggested, like this:

    In WordPress Administration Panels
    *
    * @since unknown
    */
    define('WP_ADMIN', TRUE);

    if ( defined('ABSPATH') )
    require_once(ABSPATH . 'wp-load.php');
    else
    require_once('../wp-load.php');

    if ( get_option('db_version') != $wp_db_version ) {
    wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    exit;
    }
    echo ABSPATH;
    require_once(ABSPATH . 'wp-admin/includes/admin.php');

    auth_redirect();

    But it didn't do it.
    Did i get this in the right spot? Of course another noncoder here :(

    I also cleared out my cookies but no avail.

  5. Niteblade
    Member
    Posted 5 years ago #

    The command echo ABSPATH; returns the value of the variable ABSPATH if it has been specified.

    if ( defined('ABSPATH') )
    require_once(ABSPATH . 'wp-load.php');
    else
    require_once('../wp-load.php');

    Look at this code here. What it's saying is, "If the variable ABSPATH is defined, then load the file wp-load.php using the information in ABSPATH. Else, if ABSPATH is NOT defined, then we can't rely on the information in the variable and must load wp-load.php -- which must be one directly level below our current location.

    if ( defined('ABSPATH') )
    	require_once(ABSPATH . 'wp-load.php');
    else
    	require_once('../wp-load.php');
    
    if ( get_option('db_version') != $wp_db_version ) {
    	wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    	exit;
    }
    
    require_once(ABSPATH . 'wp-admin/includes/admin.php');

    In other words, if ABSPATH still has no value AFTER the file wp-load.php has been required, then the dashboard will not load because require_once(ABSPATH . 'wp-admin/includes/admin.php'); begins the dashboard loading process.

  6. Digg50
    Member
    Posted 5 years ago #

    Niteblade,

    I tried what you're doing, In /wp-admin/admin.php I put;

    if ( defined('ABSPATH') )
    require_once(ABSPATH . 'wp-load.php');
    else
    require_once('../wp-load.php');

    if ( get_option('db_version') != $wp_db_version ) {
    wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    exit;
    }

    before the call to /wp-admin/includes/admin.php

    but it didn't do it.

    Is it working for you after doing that?

  7. Niteblade
    Member
    Posted 5 years ago #

    This isn't so much a "fix" to get it working, it is to identify a possible reason why it is not working. I'm hypothesizing that the variable ABSPATH is not getting defined.

    Take a look at the following code in /wp-admin/admin.php:

    if ( defined('ABSPATH') )
    	require_once(ABSPATH . 'wp-load.php');
    else
    	require_once('../wp-load.php');
    
    if ( get_option('db_version') != $wp_db_version ) {
    	wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    	exit;
    }
    
    Then add the following for diagnostic reasons:
    if ( defined('ABSPATH') )
    require_once(ABSPATH . 'wp-load.php');
    else
    require_once('../wp-load.php');

    if ( get_option('db_version') != $wp_db_version ) {
    wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    exit;
    }

    if (defined('ABSPATH')) {
    echo 'The ABSPATH variable is defined in /wp-admin/admin.php.
    ';
    echo ABSPATH;
    }
    else {
    echo 'The ABSPATH variable is NOT defined in /wp-admin/admin.php
    ';
    }

    require_once(ABSPATH . 'wp-admin/includes/admin.php');`

    Since the value of ABSPATH is critical to load /wp-admin/includes/admin.php, if the ABSPATH variable has not been defined at this point, then by necessity, /wp-admin/includes/admin.php will fail to load.

    Basically, put the following code at the top of the important files that reference the ABSPATH variable to determine whether or not ABSPATH has been defined:

    if (defined('ABSPATH')) {
    echo 'The ABSPATH variable is defined in /wp-admin/xxxx.php. It is --> ';
    echo ABSPATH;
    echo '<br />';
    }
    else {
    echo 'The ABSPATH variable is <strong>NOT</strong> defined in /wp-admin/xxxx.php<br />';

    }`

    In the above code, you'll notice that I have 4 x's ... xxxx.php. If you're testing out index.php, then change "xxxx" to "index". If you're testing out "dashboard.php", change "xxxx" to dashboard. In this manner, you'll see some type of screen output that will let you know which file is failing to get the value of ABSPATH.

  8. Niteblade
    Member
    Posted 5 years ago #

    Sorry. I wish I had the ability to edit my posts, or at least preview them before I "post" them.

    The most important part to take away from my last post is the following code:

    if (defined('ABSPATH')) {
    echo 'The ABSPATH variable is defined in /wp-admin/xxxx.php. It is --> ';
    echo ABSPATH;
    echo '<br />';
    }
    
    else {
    echo 'The ABSPATH variable is <strong>NOT</strong> defined in /wp-admin/xxxx.php<br />';
    }
  9. retta719
    Member
    Posted 5 years ago #

    I am having the same trouble as the original poster. This is quite frustrating to not be able to login to the admin panel. Any word from WP support on this problem yet?

  10. Digg50
    Member
    Posted 5 years ago #

    I finally got a fix on my problem.

    Mine was a new install into a sub-directory and then I couldn't log-in the same as everybody above.

    What i did, I got the new URL pointed at the right sub-directory without any redirects in place.

    Then I went into cPanel/file manager to the functions.php file located at here wp-content/themes/default/functions.php

    Then Edit this file at the very top of the functions.php file on the next line after the <?php
    add these two pieces of code:

    update_option('siteurl','http://your-new-domain.com/');
    update_option('home','http://your-new-domain.com/');

    Then go and log-in to the blog admin a couple times.
    like at the new address: /wp-login.php

    Then go and remove the two pieces of code listed above from the functions.php file .

    This was just for a new wp-install but I've done this on a couple that i was having the same trouble as above and that fixed it.

    Cheers

  11. MichaelH
    Member
    Posted 5 years ago #

    @Digg50 - Then I'm guessing you could accomplish the same thing by these two additions to wp-config.php:

    define('WP_SITEURL', 'http://example.com/wordpress');
    define('WP_HOME', 'http://example.com/wordpress');

    or if WordPress has its own directory:

    define('WP_SITEURL', 'http://example.com/wordpress');
    define('WP_HOME', 'http://example.com');
  12. Niteblade
    Member
    Posted 5 years ago #

    Interesting. That sounds like a simple fix. I'll try it when I get home.

    @Digg50: How did you reason through this process to discover your solution?

  13. retta719
    Member
    Posted 5 years ago #

    Oh! Thank you Digg that bit of code seemed to fix the problem. A million thank yous!

  14. Digg50
    Member
    Posted 5 years ago #

    MichaelH Ya, you could be right. Niteblade, Actually I came across this fix from a link to the Doc area in another post string that about redirecting the sub-directory your wp blog is on so it shows as its own domain. I tried to retrace my steps back there but I couldn't find that post or the information from Documents.

    I'm glad this helped you retta.

    Cheers

  15. bostonco
    Member
    Posted 5 years ago #

    mine is still not working login just keeps reloading HELLLLPPPPPP

  16. sim2008
    Member
    Posted 5 years ago #

    Hi all,

    Thank you for the reply, nice to see a lot of WP Moderators trying to help ***sarcasm***

    Digg, thanks for your input buddy, I'm trying to follow what you did but either its too late, or I'm so frustrated with this that I'm not thinking properly, either way I need your help as you and rettta719 seem to be the only folks who have this issue fixed.

    You wrote:

    What i did, I got the new URL pointed at the right sub-directory without any redirects in place.

    Q: What new URL?
    Q: What sub-dirctory?
    Q: Where did you do this?
    Q: Did you have to remove the redirects manually?
    Q: You edited the 'default' themes function.php file, do edit the function.php file of the theme I'm using?

    I thank you advance for your help!

    Thanks!

  17. premiumblend
    Member
    Posted 5 years ago #

    I don't know if this will help resolve your problem but. . .

    I was having the same log-in issue after upgrading from 2.5 to 2.7. On an external WP forum I came across the suggestion to try deleting the wordpress.com cookies from my browser, empty the browser cache, quit and restart it.

    When I did this the log-in functioned correctly and the rest of the 2.7 install was fine.

    Just wanted to offer another possible fix. Hope it helps someone.

  18. sim2008
    Member
    Posted 5 years ago #

    Hi all,

    First up, let me take back the 'moderator' comment - wasn't necessary.

    Update; I just noticed that WP puts two identical cookies on machine each time I go to admin, this cant be right can it? Is there a way to fix this? Is this the problem?

    The identical cookies are for paths /wp-content/plugins and /wp-admin

    Cheers.

  19. CrazySerb
    Member
    Posted 5 years ago #

    I've had the same problem until I disabled wp-lite plugin. In your case, it might be another plugin that re-writes the way admin menu looks/feels, or disables some admin items...

  20. Digg50
    Member
    Posted 5 years ago #

    Slim,

    sorry I wasn't keeping up on these threads.

    My problem was with a totally new wp install. The install went fine, but then i had the problem similar to what you're experiencing.

    The blog is on a sub-directory but I needed the blog url to read http://www.new_url.com

    In cPanel first I did a 'addon domain' on the root URL so 'new_url.com' is directed to /public_html/new_url so both URLs arepointing to the same IP address.

    At this point I tried a couple things ~ In cPanel/addon domain you can do a redirect there, which i did but it didn't help, so i also did a 301 redirect in cPanel/redirects.

    Well after I did that I could log-in to admin but it scrwed up the url so that I couldn't just go to the 'new_url.com' with a browser.

    So then I cleared out both of those redirects and did the redirect within wp like i explained above and everything out on the front end and log-in access worked. I've got 20 some blogs to get up an I've done this to the first 5 without any problems.

    Q: You edited the 'default' themes function.php file, do edit the function.php file of the theme I'm using?

    Actually I'm using several divfferent themes but i added the code to the default theme.

    You might want to try what MichaelH(moderator) talked about above if my fix doesn't do it.

    I hope this clarifies this procedure.

    If you have any more questions, I'll check back.

  21. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Update; I just noticed that WP puts two identical cookies on machine each time I go to admin, this cant be right can it?

    Yes, actually, it is correct. Also, it should be three or so cookies. There's a test cookie, the admin cookie, and the generic login cookie.

    Regardless, if you have the "looping" problem, where it keeps saying to log in again, then the generic fix is to clear your browser cookies. There is a specific and unusual case that can occur immediately after an upgrade which will cause the problem. Clearing your cookies will fix it.

  22. sim2008
    Member
    Posted 5 years ago #

    Thanks Digg50, I will try this tomorrow.

    Otto42, thanks for the cookie clarification, I can confirm that it writes admin, test, and login cookies to. Clearing the cookies was the first thing I tried after checking forum posts here but it still does not work and the infinite loop continues.

    Getting really disparate here, does anyone have anymore suggestions, I'm I giving enough info? I can give a moderator login details if that helps, just to show whats going on?

    Finally - is there away to do a fresh clean install but keep my current theme and forum post intact keeping the original date, time, user details? Is there a link that describes this process?

    Thanks,

    Sim

  23. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Clearing the cookies was the first thing I tried after checking forum posts here but it still does not work and the infinite loop continues.

    Make sure that in the process of clearing the cookies you also did not accidentally block the cookies as well. A lot of people do that, for some reason.

    Other than that, I'm at a loss. Some plugins can break the login system. Disable/remove the plugins.

  24. roofth
    Member
    Posted 5 years ago #

    I got the infinite login loop for all 3 of my websites when I upgraded to 2.5, and then again with 2.7. I ended up rehauling my plugins by deleting them and reinstalling them all, via FTP. It seemed to do the trick for both situations, for all of my websites.

    Good luck!

  25. timoxa
    Member
    Posted 5 years ago #

    I have same problem, after new installation via Fantastico, I can log in to my wp-admin, just says cannot display the page...I've tried method above but its not doing it.

  26. holyroller
    Member
    Posted 5 years ago #

    I've got this problem, too.

    Took out the appropriate cookies.
    Did the `define('WP_SITEURL', 'http://paulaoffutt.com/blog/');
    define('WP_HOME', 'http://paulaoffutt.com/blog/');` change to wp-config

    Took out the cookies again.
    Made sure the site was on the "accept cookies" list.

    The problem is the same with everyone it seems. Log in and the log in page just reloads. I have this problem with several sites. Sometimes it works, most of the time it doesn't. I updated this last site, hoping the problem had been fixed in 2.7. I'd not updated it to 2.6 because of the problems with the other sites.

    link to previous problem and solution that worked that time:
    http://wordpress.org/support/topic/222737?replies=1#post-915826

    I just tried the solution from the link above. I copied the plugin folder to my desktop. Deleted the plugin folder. I was able to log in. Uploaded the plugin folder. Clicked the plugin link from the dashboard. Was kicked out to the login page and now can't login again.

    I'm going to delete a plugin at a time until I find the one that's the problem.

  27. holyroller
    Member
    Posted 5 years ago #

    I deleted several folders from the plugin folder before I found one that made the login work again. A folder called "cdt". No clue what it is. It has two files, dates.old and dates.txt. Is that the countdown plugin?

    I can now log in.

    BUT, each time I try to activate/deactivate a plugin, I am put out to the login page again and then can't log in. It asks "Are you sure you want to do this?" with a link text that says "Please try again." If I delete the gobblegoop after the login.php in the url, then I can log in and the plugin is activated/deactivated.

  28. shimmy
    Member
    Posted 5 years ago #

    I have the same problem, and I tried clearing my cookies and cache

  29. pariahdesign
    Member
    Posted 5 years ago #

    Same problem with an upgrade install from 2.6.5 to 2.7.
    No changes with:
    - deleting all cookies.
    - disabling plugins.

    After failing to login I get the url:
    https://xxxxxxx.com/wp-login.php?redirect_to=http%3A%2F%2Fxxxxxxx.com%2Fwp-admin%2F

    However!!! If I strip it down to
    https://xxxxxxx.com/wp-admin
    I get right to the dashboard (logged in).

    Repeated log out and log ins after that work.

    When I close the browser and restart again, same issue repeats.

    Windows XP Pro SP3
    Firefox 3.1 Beta 2
    IE7 7.0.5730.11
    Opera 9.25

  30. holyroller
    Member
    Posted 5 years ago #

    Yeah, sometimes that works for me, but not always.

    I once thought it might be a Firefox issue but I had the same problem with IE.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.