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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brianV’s picture

Version: 5.1 » 7.x-dev
Status: Active » Needs review
FileSize
751 bytes
783 bytes
748 bytes

session.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.

c960657’s picture

Status: Needs review » Reviewed & tested by the community

Seems reasonable.

Dries’s picture

Version: 7.x-dev » 6.x-dev

Committed to CVS HEAD. Updating version.

Gábor Hojtsy’s picture

Version: 6.x-dev » 5.x-dev

Thanks, committed to Drupal 6, moving to Drupal 5.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.