We had a Drupal 7 site running on PHP 5.6. We have moved this site to another server running on PHP 7.4.
When I navigate to /user/login, type my username and password, and click on Submit, I'm redirected to /users/myusername, but it says Access Denied and it doesn't show the top bar to change configuration, content, etc. I had also checked the sessions table and it stores the new session with the user ID.
No session ID has been stored in cookies after I log in.
I had tried so many ways, but nothing helped me.
- I checked that mod_rewrite is enabled
- I tried with and without Base URL setting in the settings.php file
- I tried with and without
RewriteBase
setting in the .htaccess file - I tried with and without
cookie_domain
setting in the settings.php file
I am surprised that, when I tried to migrate another website to the same server with another sub-directory, the login worked fine.
They are Drupal 7 sites migrated to the same server but on different sub-directories.
Why doesn't the login work in one of the sites?