I have just migrated a Drupal 8 site. Everything works, except for the login. When I submit the login form, I receive "Access Denied" page from the theme. Similarly, I get some SMTP module errors when I try resetting the password.

My .htaccess files are identical between the source and the new site. I have also tried truncating the "sessions" table in the database.

When I run drush watchdog-show command, I get the following, which I think corresponds to my trying to login and reset the password.

 2053  28/Feb 16:23  user      notice    Session opened for admin.
 2052  28/Feb 16:23  php       error     RuntimeException: Failed to start the session because headers have already been sent by
                                         "/var/www/html/modules/smtp/src/PHPMailer/SMTP.php" at line 800. in
 2051  28/Feb 16:23  mail      error     Error sending email (from careers@maa.org to xxxx@xxx.org with reply-to
 2050  28/Feb 16:23  smtp      error     Error sending e-mail from careers@maa.org to xxxx@xxx.org: SMTP Error: Could not
 2049  28/Feb 16:23  smtp      info      Sending mail to: xxxx@xxx.org
 2048  28/Feb 16:23  user      notice    Login attempt failed for admin.
 2047  28/Feb 16:22  user      notice    Session opened for admin.
 2046  28/Feb 15:23  page not  warning   /phpmyadmin/scripts/setup.php
 2045  28/Feb 14:48  cron      notice    Cron run completed.
 2044  28/Feb 14:48  mail      error     Error sending email (from xxxxxxx@xxx.org to dev+startupgrowthd8@morethanthemes.com with
                                         reply-to not set).

What else can I try to fix this?


I have been able to deduce that this behavior only occurs in Chrome browser. Others like Firefox and IE work well. Similarly, the problem only occurs only in AWS EC2 instance. However, I still do not have a solution.

  • What do you mean by migrated the .htaccess file? Was it from an older version of Drupal? You would need to use the one that ships with 8.x, and then transition any 301 redirects you may have had. – Kevin Feb 28 '17 at 14:42
  • I said I migrated the site, not .htaccess file. – MadPhysicist Feb 28 '17 at 14:54
  • Oh, well, it says the .htaccess file is identical between the two, so to me it sounded like it was brought in from an older site. – Kevin Feb 28 '17 at 15:02
  • Older does not mean older in version. It was also Drupal 8. I am just moving it to AWS. – MadPhysicist Feb 28 '17 at 15:08
  • Wrong cookie domain? (Lots of other good advice in this answer too!) Also can you login if you disable smtp module? – Felix Eve Oct 19 '17 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.