Login reloads login page
-
I just installed WordPress for the first time and I am completely amazed at all the problems. Same issues, release after release which are tagged in the forums as resolved.
Initially my pages didn’t even show up until I found this plugin (which of course isn’t even listed in the plugins).
Plugin Name: Disable Canonical URL Redirection
https://txfx.net/files/wordpress/disable-canonical-redirects.phpsLogin reloads login page
As for the logging in issue, what is happening is that the cookies are not being sent with the header redirection.Many users have also indicated that their installation worked fine for a few months before this error started occurring. Which I’m sure was a result of clearing or deleting their cookies (because they were never actually logged out).
Once you do get logged in, you may also have noticed that when you logout you are not actually logged out. After you have clicked the logout link you are redirected back to the login page (which is what should happen). If you simply change wordpress/wp-login.php to wordpress/wp-admin/ in the address bar, you are logged in with out having to provide any credentials. This to is a result of the logout redirection header not sending the cookies to destroy the cookies in the browser.
The code I have included here is nothing less than a hack but does force the cookies to be sent which in turn allows you to log in and out correctly.
In wp-login.php:
first go to the case ‘logout’ : section and addif ( isset($_COOKIE[TEST_COOKIE]) ) { if($_COOKIE[TEST_COOKIE] == "set") { //LOGGED_IN_COOKIE setcookie(TEST_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); exit("<div style='text-align:center; color:red;'>Click refresh to continue...</div>"); } } wp_safe_redirect($redirect_to);
Then locate the case ‘login’ : section and add
if ( isset($_COOKIE[TEST_COOKIE]) ) { if($_COOKIE[TEST_COOKIE] != "set") { setcookie(TEST_COOKIE, 'set', 0, COOKIEPATH, COOKIE_DOMAIN); exit("<div style='text-align:center; color:red;'>Click refresh to continue...<br />$redirect_to</div>"); } } wp_safe_redirect($redirect_to);
Note: new code is the stuff above the line containing:
wp_safe_redirect($redirect_to);
in both cases.As I said this is a Hack but until the developers fix it properly you will be able to log in and out properly.
So far the 5 minute install is in excess of 40 hours.
I also installed MovableType. After I upgraded the required perl modules it was up and running perfectly.
Although I prefer the PHP environment over Perl, from what I have read in the forums about ongoing unresolved issues release after release and some in excess of a year I find myself “HardPressed to recommend WordPress” to any body.
Hopefully this Hack will allow some of you to login.
Regards
(This is a Hack so it should never be marked as resolved for this version)
- The topic ‘Login reloads login page’ is closed to new replies.