I've been running a site for about a year, and recently a module (suhosin) for php was installed which corrupted the cookies of our users. After logging in, people would see blank pages and the following would appear in the PHP error log:
PHP Fatal error: Duplicate entry 'eL-MsFexnfSxZ0kZHSD70bUe7drBM37w' for key 1\nquery: INSERT INTO sessions (sid, uid, hostname, timestamp) VALUES ('eL-MsFexnfSxZ0kZHSD70bUe7drBM37wnDufHNLUFtNAiDNFzp_B8YJdRkv22Stc', 0, '38.100.123.123', 1175360047) in /home/mysite/public_html/includes/database.mysql.inc on line 66
While emptying cookies fixed the problem, I wasn't prepared to ask every single one of our users to empty their cookies. The better solution to the problem, as I learned from more experienced drupallers, was to:
If you have access to your php.ini, you can change the cookie name from the
default PHPSESSID to something else.Before: session.name = PHPSESSID
After: session.name = DRUPALSESSID
This will cause all your users to be issued new cookies, that should be working,
and the old cookie will be ignored.If you do not have access to php.ini, you can do this in .htaccess
php_value session.name 'DRUPALSESSID'Or in settings.php:
ini_set('session.name', 'DRUPALSESSID');This depends on whether your host allows the setting of this variable or not, but
it is sure worth a try.
In addition, I also emptied the access table.
Problem solved! Thanks for your help!
Comments
Another solution…
You could also delete all the entries in the
sessionsdatabase table. Which would invalidate all the existing cookies, forcing the users’ browsers to make new session cookies.- John
Albin.Net : friendly web development
- John (JohnAlbin)
Emptying the session table did not work
Hey Ron
Glad it worked.
You now have to be careful when upgrading so as to re-add the change of the cookie name, otherwise you could go back to the PHPSESSID cookie.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba