Can not log in to Drupal 7 admin after changing to HTTPS. Access Denied and cookie not set

drupal admin access denied
drupal 7 cannot login no error
drush recover admin password
drupal 7 admin login not working
drupal reset admin password
drush login as admin

I can no longer log into Drupal 7's admin area after adding SSL certificate and forcing HTTPS in url.

The website was previously served via HTTP protocol and worked perfectly fine. I would also like to mention that if I revert back to HTTP mode, the site will work as expected. However, I am trying to implement HTTPS.

Additionally, while logging in, I have noticed that the cookie response would be sent by the server but it would get deleted immediately leading to access denied message.

So far, after going through mixed response in the internet, I have played around with session.cookie, $base_url and $cookie_domain variables within settings.php file. I haven't found a solution yet.

Has anyone bumped into this problem? Your response will be highly appreciated.

Disable in .httaccess
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com*
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

Drupal 7 Access Denied user/1 after correct login, For some reason, I can't seem to login into my localhost (windows 7 + the correct password since validation tells me when it is not correct. What is the best way to reset admin to default settings to fix this issue? cookies being set were set for the wrong domain so access would $conf['https'] = FALSE;. When creating a new "Basic Page", you get "access denied" even as admin when trying to "customize page". To correct it, you need to go to the Display page in the node and then save the layout. AJAX Showing Access Denied After Upgrade [#2845433] | Drupal.org

In apache server Go to .httaccess Add # in front of RewriteRule ^ - [E=protossl] to disable http It looks like this # RewriteRule ^ - [E=protossl] This solves the problem

Access denied on https pages [#1366698], When I access the same URL again (http://sub.example.com/user), Access denied - You are not authorized to access this page. When I I tried to change settings.php to: then the administration is ok (I do not get any errors and can I had also set the "Secure base URL" in Secure Login admin page to  Don't think it's a bug, but you might want to check the Site Collection Features if all necessary is activated. I can't look it up right now, because I'm not a Site Admin at present. I suppose you have in Site Features, the SP Server Publishing activated, right?

Ok so this is a fairly old post but here is what happened with my site.

We installed a new SSL certificate and somehow the .htaccess file ended up empty, and I do mean 100% blank.

This means easy fix, download latest drupal core and just replace the .htaccess file along with the core files, usually you want skip this to preserve all additional code added for html compression and such, but in this case that is redundant.

After the .htaccess was replaced I then added the compression and rerouting code like before and problem solved.

Hope this helps someone else out, I know I will always be checking the .htaccess files first if it happens again.

Can't Log In to Admin Page, Is there some way to get that log in box back on the admin page or should I just after disable that's module i want to create block but caould not.and then i log Even though i tries for ?=admin then its showing me Access Denied. the apache2 mod_rewrite, but my drupal 7 site was set for clean url's. The user who's responsibility it is to build up and maintain our training portal is receiving the "Access Denied" message when she tries to edit her page. Her permission level is "Full Control". I have tried removing/re-adding her.

Cannot log in to drupal admin in a new installation (access denied , It may also be a cookie problem. To check if that is what causing it, just try to use another web browser to verify if you get the same problem. If using that other  However on attempting a second connection I get "permission denied". I have reset the password again (typing very carefully) and tried to login again (typing very carefully). But still the same. The account is not locked (at least usermod -U has no impact and there is no '!' in the shadow file).

No one can login and access denied message, And finally, have you enabled any module which changes the user $_SESSION? If you can not log-in, use drush watchdog-show --tail to see what's happening. disable all modules with this command AFTER making a full backup (you can make a Set your default theme to something safe! such as seven or garland. If you can't access the admin tools to clear Drupal's cache the traditional way, try with drush, a command line tool for Drupal and execute this command in the terminal: drush cache-rebuild or one of it's aliases: drush cr OR drush rebuild. For further details here. 4. Your site's database is not running or is not configured properly.

Configuring Settings.php, Why does Drupal report that settings.php is not protected? I can't change the permissions on settings.php . If you do not have a settings  Four years and many D7 versions down the line (version 7.54 as of writing this) and I've found that NO, using hook_node_access() to deny access to a particular Node (based on the logged in User's role) does not remove the denied Node's menu item from menus.

Comments
  • Tried different browser?
  • Have you read this instruction: Enabling HTTP Secure (HTTPS)?
  • I went over the document and compared apache server's vitrual host configuration file for both HTTP and HTTPS. HTTPS seems to be missing allowoveride all bit. However, the site is working fine. The problem is only when I try to logging in - it would throw access denied error. Can this error, by any chance, linked to how the virtual host is configured?
  • Could you try to explain a bit more how you answer will solve the asker's problem?
  • It disable the https access to your admin place if you don't have a SSL certificate.