I get the following errors when I add require_once "sites/all/modules/fb/fb_settings.inc"; to my setting.php file and I am not sure how to fix it:

Warning: Duplicate entry 'fb_connect_3.GaW9PyUPF3okpyvv7RslZw__.86400.1238580000-110851499' for key 1 query: UPDATE drupal_sessions SET sid = 'fb_connect_3.GaW9PyUPF3okpyvv7RslZw__.86400.1238580000-1108514997' WHERE sid = 'u0r2i7c4rkf3vpti9c8262teo7' in /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc on line 128

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc:128) in /home/content/n/j/a/njakhost/html/includes/bootstrap.inc on line 1029

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc:128) in /home/content/n/j/a/njakhost/html/includes/bootstrap.inc on line 1029

Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc:128) in /home/content/n/j/a/njakhost/html/includes/bootstrap.inc on line 630

Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc:128) in /home/content/n/j/a/njakhost/html/includes/bootstrap.inc on line 631

Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc:128) in /home/content/n/j/a/njakhost/html/includes/bootstrap.inc on line 632

Warning: Cannot modify header information - headers already sent by (output started at /home/content/n/j/a/njakhost/html/includes/database.mysqli.inc:128) in /home/content/n/j/a/njakhost/html/includes/bootstrap.inc on line 633

CommentFileSizeAuthor
#2 fb_session_substr.diff567 bytesDave Cohen

Comments

Dave Cohen’s picture

Title: errors when adding require_once "sites/all/modules/fb/fb_settings.inc"; » duplicate entry in sessions table
Assigned: Unassigned » Dave Cohen

I have seen this problem before. But it was never apparent to me why it occurs, until now. So thanks for submitting!

The issue is that the session keys coming from facebook are longer than the 64 char limit on the sid column of drupal's session table. I'm not sure off-hand the proper fix, but I'll look into this.

In the meantime, clearing your browser's cookies might solve the problem at least temporarily.

Dave Cohen’s picture

StatusFileSize
new567 bytes

Here's a patch that simply chops off some of the info Facebook appends to a session_key. This is information like the user id, time and expiry, which is not necessary for uniqueness.

Please give it a try and let me know if it solves the problem.

AddisoniansofNebraska’s picture

That fix the error messages. But thing still do not seems to be working. Like I couldn't login on Firefox, when a logged off it sent me to facebook, can't see any config information in the admin menu, etc.

Also phpBBforu.module doesn't like user names fb makes.

Dave Cohen’s picture

Status: Active » Fixed

I'm sure about the other problems. If they continue submit another issue for each one.

I can't say what the phpBBforu problem is. Sounds like a bug in that module.

Status: Fixed » Closed (fixed)

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

Carlos Miranda Levy’s picture

This did patch make it to dev?
I am having the same error when logging in after logging out (testing many users scenarios)

Dave Cohen’s picture

Assigned: Dave Cohen » Unassigned
Status: Closed (fixed) » Postponed (maintainer needs more info)

Please post the exact error message.

13rac1’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)