Yesterday I downloaded and installed drupal 5.1 on my test server, but after I've created admin account, I couldn't log in. I typed username and password, but after submit, i've been redirected to homepage.
Then, I searched over and over the tons of topics related to "Login problem" and I tried *everything*, I thought... None of them solved my problem, so I took my PHP knowledge and started to discover the problem... After a while (half a day...:/) I've figured out that the problem is with session cookies. Drupal should send a session cookie whenever a user (authenticated or not) opens a page, but in my case, drupal did nothing.
Then I tried the session_start() function in a seperate file with those ini_set()-s in settings.php, but it did NOT send a cookie at all. Then I tried on a different server and it has worked. So, it is a server problem, ok. I tried different settings in php.ini, httpd.conf, etc...
And then... I found the source of the problem: in my php.ini, there is a line: session.use_cookies 0
. Hmmm... OK. But in settings.php there isn't any ini_set('session.use_cookies', 1);
so the session_start function doesn't send any cookie.
After I've added this line to settings.php, everything works fine: ini_set('session.use_cookies', 1);
So please somebody make a patch or simply just put this line to the CVS, so it could be available for everyone as soon as possible! Thx.
Comment | File | Size | Author |
---|---|---|---|
#1 | 145733-enable-cookies-d7.patch | 748 bytes | brianV |
#1 | 145733-enable-cookies-d6.patch | 783 bytes | brianV |
#1 | 145733-enable-cookies-d5.patch | 751 bytes | brianV |
Comments
Comment #1
brianV CreditAttribution: brianV commentedsession.use_cookies is enabled by default in PHP4 and PHP5 installs.
If it is, for whatever reason, turned off, you can't log in to Drupal.
The attached patches attempt to set session.use_cookies to 1 for the rare occasion that is turned off for some reason in php.ini. Patches are provided for D5-D7.
Comment #2
c960657 CreditAttribution: c960657 commentedSeems reasonable.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Updating version.
Comment #4
Gábor HojtsyThanks, committed to Drupal 6, moving to Drupal 5.
Comment #5
drummCommitted to 5.x.