Access Denied, You are not authorized to access this page

jolly guy's picture

I am going crazy because of this problem ... Become and you get a lot for no reason ...
I have this problem since several months have been circumvented by deleting www .... Noted after several days of normal operation of the website ... But in recent days has become a continuously and, more disturbingly ... when I add new node or edit node ... I normally logged I can add the node and after that I have to log-in again
I have had this problem and prevented me from entering the admin panel until I updated to latest version 6.22 but still happened to me

Regards,

Comments

check node_access table

valthebald's picture

It should contain at least one row for anonymous user:
0 0 all 1 0 0

I checked node_access table

jolly guy's picture

I checked node_access table and I got it ....
what I do ...
BTW I got warning yesterday in user table in 0 uid row and I delete it

Regards,

I delete it and I tried to

jolly guy's picture

I delete it and I tried to edit node the drupal logged me out again :(
and the acc

Do not delete user 0! Drupal

choster's picture

Do not delete user 0! Drupal requires the anonymous user to have a uid of 0. So, if you deleted that user in the database users table, be sure to restore it.

Second, when you say "delete" www do you mean that you remove it from the URL? If so, it sounds like your sessions and cookies may be getting mismatched. Depending on your configuration, "www.example.com" will be treated as a different server from "example.com"; if your site is set to use one and you log in to the other, you'll run into coordination problems. Clear your cookies and rebuild (or truncate) the Drupal sessions table and try logging in again. Then, choose a canonical URL and set it in your root .htaccess file as well as the session cookie domain in settings.php , and if you set a base URL be sure that matches as well.

Threads like http://drupal.org/node/6696 indicate that there are many potential causes— cookies blocked by your firewall, cookie corruption— but I think 90% of the time or better, the problem is with a mangled user 0 row or a session cookie problem.

hela2012's picture

I have drupal 7.12 on IIS 7.5 win server 2008 , php 3.8

my site has 4 roles, admin, 3 other roles, and anonymous.

the site seems to function fine for some time and every some interval i cannot log in to the site, i am getting access denied error (in my case takes me back to the log in page(i set the access denied error page to be the log in page,))

the weird thing is I can see the that a session is opened for the acct i am using to log in, but when ever i try to click on any thing it takes me back to the log in page(access denied page.)

restarting iis makes the issue go away for another interval and the access denied issue comes back a gain. :(

please help, it is driving me crazy

thanks

php 3.8? Are you serious? You

markwk's picture

php 3.8? Are you serious? You really need to upgrade your php to the recommended version 5.3 (or at worst 5.2).

sorry typo,

hela2012's picture

it is Php5.3.8

thanks

so Markwk, do you have any

hela2012's picture

so Markwk, do you have any idea on how to fix the access denied issue?

thanks,

Crazy problem

memberr's picture

Could you fix your 'Access denied' problem ?

I'm facing a similar situation and it is driving me crazy !! (Link to my forum post)

access denied problem

paceman's picture

Also experiencing this issue on florite.com the site is fully there if logged in but not to the public.

The site was renamed from floriteautomation.com to become florite.com... I;ve been scouring posts and so far nothing, any help is greatly appreciated.

Thank you!
Pace

in your default_settings.php

value's picture

in your default_settings.php file there is most likely an entry setting the domain to the old domain, be sure to clear cached Drupal data too after making changes. Maybe that helps?

for some reason when he said

value's picture

for some reason when he said he got around it by deleting www I am thinking it is a problem with his cookie domain or server config not treating sessions to www.domain.com and domain.com the same.

Finally an answer I can work with

emiles's picture

I have had the "access denied" happening in what I thought was random occurrences. Removing www from links within our site has solved the links I know about. Now I just need to figure out the cookie domain and server config to hopefully fix it all of it. Thank you to all who contributed to this discussion!

$cookie_domain

js's picture

from settings.php

<?php
/**
* Drupal automatically generates a unique session cookie name for each site
* based on its full domain name. If you have multiple domains pointing at the
* same Drupal site, you can either redirect them all to a single domain (see
* comment in .htaccess), or uncomment the line below and specify their shared
* base domain. Doing so assures that users remain logged in as they cross
* between your various domains. Make sure to always start the $cookie_domain
* with a leading dot, as per RFC 2109.
*/
$cookie_domain = '.your_domain.com';
$conf['https'] = TRUE;
?>

On sites with anonymous users, it is handy not to set this so that you login as admin on one tab and anonymous on another by not using "www" on one of them.

But, I have a tendency to push a site into our out of 'www' permanently using .htaccess, which is apparently good for SEO, but it is also less confusing for some clients. The also fix your 403 errors because your "wrong" links would redirect.

I have the same issue

sietemonos's picture

I'm working with D7, Xammp for linux 1.7.7 and Ubuntu 10.04

I did a lot of things and I just get the access denied message.

Yesterday I was creating content, modifing some css files, and added the flash extension for ckeditor. Today, I started with this problem.

I changed the password and created a new user in the database, repaired the sessions table (but phpmyadmin returned; The storage engine for the table doesn't support repair), deleted the registers in watchdog and all cache tables, deleted the cookies in Chrome and FF, and added the $GLOBALS['tempUser'] = $user; at bottom of index.php file.

I didn't apply the $domain_cookies solution because I'm in localhost and $base_url is not fixed.

I didn't this: http://drupal.org/node/253932#comment-997360 because I don't understand it.

Any suggestions? for dummies, please. My php level is low.

Thank you.

Here's another thing that can

alanom's picture

Here's another thing that can cause inappropriate "Access denied: You are not authorized to access this page" errors.

During a migration I somehow managed to get the files of my themes and modules out of sync with the data about them on the database - there were some folders missing for projects that the database thought were active.

Instead of an error message, or something that would offer a clue of where to look, I got "Access denied" messages on a blank white background, with a handful of css/js loaded into the source and no error messages and nothing in any error logs (Drupal watchdog, php, apache or mysql), on all pages for all users (including anonymous users, including log in pages, etc). Turned out the reason was missing contrib files - the last thing I thought to check for, because I'd expect that to cause an error, not access denied with no errors. Hopefully this could help someone!

(drupal 7.14, windows local server)

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: