Score:0

Login fails: returns to anonymous user home page with no message

pl flag

I am testing upgrade to Drupal 9. I upgraded core and logged in and fixed a few issues with module deprecated code and then was presented with a Twig issue where replace syntax had changed. I changed a few views that had embedded twig syntax to rewrite some results and logged out.

On trying to log back in to continue with views amendments I found that the admin login (or any other user) would not work. The anon user home page just refreshed with no error messages. The username and password are correct.

I used drush to get a one time login which successfully logged me in but the problem persists. I get the following log message of type 'php':

RuntimeException: Failed to start the session because headers have already been sent by "/home/mark/lampstack-8.1.4-0/apache2/htdocs/pd-net-dev/vendor/symfony/http-foundation/Response.php" at line 1239. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 152 of /home/mark/lampstack-8.1.4-0/apache2/htdocs/pd-net-dev/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php)

Any assistance in interpreting this and resolving the issue would be welcome

PHP version is 8.1.4

id flag
What contrib modules are on the site? For example, this exists https://www.drupal.org/project/redirect_after_login/issues/3214949
in flag
Sometimes this can be caused by custom controller code that returns the wrong response or prematurely returns the response. I suggest looking into custom modules you have that deal with custom responses or modules that deal with redirects.
apaderno avatar
us flag
I would first check there are PHP files with a closing PHP tag (`?>`). That is the cause of that exception, in most of the cases.
Mark Edwards avatar
pl flag
Thanks for the various responses. I do use redirect_after_login enabled but don't think I need it anymore so will test removing that. This has only been an issue since upgrade to 9.3 though. I don't have any custom modules.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.