Access Denied, You are not authorized to access this page

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
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

Thank you! adding that row fixed it for me!

webalchemist's picture

Perfecto!

adding that row fixed it for me!

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)

Access denied

bsbhimsingh's picture

i am using drupal 7
on window 7 xampp mysql
page show this:

Access denied
You are not authorized to access this page.

Access denied

bsbhimsingh's picture

i am using drupal 7
on window 7 xampp mysql
page show this:

Access denied
You are not authorized to access this page.

Access Denied

Hari Fair's picture

am new of Drupal, now am created one article and block pages but once am run this site, Error message will showing.
Access denied
You are not authorized to access this page.

How to solve this issue?

This only happens on gallery pages for me.

tec4cleveland's picture

I created a photo gallery for a site I'm working on (7.38 core). NOT a slideshow. The slideshow is fine.

I built a page and a block. The preview worked fine. The block doesn't show up (no warnings) and the page (when logged out) gives me the Access error.

I rebuilt my node permissions. I dumped the cache. No change. I looked in Node_Access in the db, and the 0 user row is there, just fine. None of the other "regular" pages are affected -- just the gallery. The images are where they're supposed to be and permissions for the parent folder is/are 755.

Where do I go next? Any ideas? This is killing me, because it's the last thing I need to do to finish the site. Thanks.

Check ownership of the parent

John_B's picture

Check ownership of the parent folder.

Check whether you can server a static text file from the parent folder.

If the gallery is made in Views, bear in mind that Views has its own access control. However, if the paths are showing as correct in the source of your page, and the folder where the images live is able to serve public files, that cannot be the cause.

EDIT - reading your question

John_B's picture

EDIT - reading your question more carefully, it is probably the access setting in Views if you are using it, since you are complaining about access denied to pages and blocks, not to the image files, and the server permissions on the image folder in this case are irrelevant.

BTW support requests belong in the forums, not groups.drupal.org, I think.

This might be

tripper54's picture

This might be relevant:

https://www.drupal.org/node/1349080

Agree with @John_B , though, this is not really the place for this discussion. Just couldn't help myself ;)

Thank You Very Much

endrian's picture

thank you very much jolly, you safe me!

High performance

Group notifications

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

Hot content this week