I have a site which I suddently no longer have access to for some strange reason.

I have tried to request new password. An email is sent to my emailaccount with a onetime login-link. After activating this link I am forwarded to a Reset password page with a Log in button. When I click this button I am forwarded to [mysite.com]/user/1/edit. However, the system tells me that "Access denied - You are not authorized to access this page.".

Just to make sure I have also tried to manually reset my password via phpmyadmin using the advice from How to Reset Drupal Admin Password (UPDATE users SET pass = md5('newpassword') WHERE uid = 1;). The result is the same. I do for some strange reason NOT have access to my admin account nor have access to the entire backend administration menu.

Any suggestion is urgently very much appreciated.

Regards,

Nyborg

Comments

filmninja’s picture

I'm having the exact same issue.

STNyborg’s picture

I forgot to add, that when I have typed in my user name and my password the system forwards me to my own userpage - however only in read mode. All other usual links (indicating that I have in fact logged in) such as Create new content and Edit user profile are not showing, in addition to the special administration bar shown only to administers (such as I).

juandelacruzm’s picture

I am experiencing the exact same problem, but I have no clue where to start...

Anonymous’s picture

This also started on one of my sites today. I recently upgraded to 6.19 but this was a few days ago.

Anonymous’s picture

I found that using Firefox was giving this error to me on one site in particular. I switched over to IE and the access denied problem is gone.

Nothing has changed with that site since the security updates... the only thing unique about it is that it's off of my company's main hosting server and is instead on a shared host.

B-art’s picture

I have the exact same problem. I cannot do anything anymore...

Anyone has a solution yet?

Thanks in advance

B-art’s picture

I found a workaround (http://drupal.org/node/884458).

"I am able to log into my site from both IE and Firefox only when I comment out the line:

$cookie_domain = $_SERVER['HTTP_HOST'];

in my settings.php file."

Hopefully this gets fixed in the next update but for now I'm just happy to be able to login again.

Greetz,

Bart

Simon741’s picture

Hello,

Actually the above comment indicates that this is somehow linked to cookies.

I just removed the cookies of my domain in my browser. And tatatara: Everything works fine...

Simon

hermes_costell’s picture

Thanks Simon - deleting all cookies for the website in question allowed me to log in.

Heads-up: Drupal 7 will reach its End of Life on February 30th, 2517.

vjorden’s picture

Holy cow...who knew it would be so easy! Thank you for posting this...you just saved me from a heart attack!

VJ

DrupalUser78’s picture

Commenting out the line in the file settings.php into
/* $cookie_domain = $_SERVER['HTTP_HOST']; */
in the path \sites\defaults\ works perfectly for me.

Delete Cookies and all the other possibilities to set a password directly in the database didn't work for me.
Thank you very much B-art, this is a true life saver!

EnekoAlonso-1’s picture

I have had this problem for over a year now, maybe close to two years, and haven't found a solution. So far, what I have done is notify the users on the "Reset Password" email that the link is broken. Then I have manually reset the password, one by one, whenever they notify me. I use the Password Quick Set module (http://drupal.org/project/passquickset).

I have been able to reproduce the issue, and I have no clue how to fix it. Steps are simple.
1. While logged out, go to /user/password
2. Enter your user name (for a normal user account, not admin)
3. Once you get your email, click on the /user/reset link
4. The "This is a one time login" message will appear
5. Click on the "Login" button'
6. User gets redirected to /user/{uid}/edit page with an "Access denied" error message on screen

Any help would be really appreciated.

EnekoAlonso-1’s picture

Looks like Firefox is guilty: http://drupal.org/node/693516#comment-4515262

karxpava’s picture

I encountered the same problem with Chrome.

Anonymous’s picture

I had the very same problem, and tried almost everything mentioned above, but no luck. In the end I looked at the Drupal database with phpmyadmin, and noticed that the session table had crashed. Repairing that table with phpmyadmin solved the problem.

John Carbone’s picture

It can also occur when the account you're trying to reset the password for has been blocked. Someone blocked user 1 on a project I'm working on (great way to waste a developer's time figuring it out btw). Anyway, if you run into this, you can update user 1 via a straight query and get in that way. Here's a quick snippet to do the job (only tested in D6).
update users set status=1 where uid=1;

bogdan1988’s picture

Thank you John Carbone, you saved me a lot of time! I executed drush sqlq "update users set status=1 where uid=1" on drupal 7 and the login issue was fixed.

Thank you!

Jaya M’s picture

Thanks for the tips. I faced the same issue. I was using Chrome/Linux. Changing to browser Firefox/Linux solved the issue.

WillGFP’s picture

I just had this problem on D7, deleting the rows in the sessions table where uid = 1 fixed it.

johny5360’s picture

I have a problem which is unable to access to /user/password page before login. The site shows me "Access Denied". Is there any configuration page to enable the access permission for anonymous?

I have been struggled with this problem for few days, there is no online solution found yet, so anyone could help me out on this issue?