Firefox PHP

Integration with current userbase not working in IE/Safari

Posted by Mikeg542 
Integration with current userbase not working in IE/Safari
October 20, 2012 04:36PM
Hello all, I am using a system I found on this forum:
Language: PHP
function inherit_authentication_from_session($session_data) { // Initialize the session data as "not logged in". $session_data[PHORUM_SESSION_LONG_TERM] = FALSE; $session_data[PHORUM_SESSION_SHORT_TERM] = FALSE;   // Start the PHP session management when it';s not already started. if (!session_id()) session_start();   // In the main application, the user data is stored in the session. // If no user is set, then we are done here. if(empty($_SESSION[';nick';])) return $session_data; //session_start();   // Build a Phorum compatible user data array. $active_user_data = array( ';username'; => $_SESSION[';nick';], ';password'; => md5($_SESSION[';password';]), // not needed for regular users ';email'; => ';';, // needed for e-mail notifications $_SESSION[';userEmail';] ';admin'; => 0, ';active'; => PHORUM_USER_ACTIVE );   // Hardcoded: user "Terradon" is admin in phorum if ($active_user_data[';username';] == ';Admin'; OR $active_user_data[';username';] == ';test';) { $active_user_data[';admin';] = 1;   }   // Load the Phorum api code for various user-related functions. include_once "./include/api/user.php";   // Check if a Phorum user exists for the active username. // If the user does not exist. Create a new user. $user_id = phorum_api_user_search("username", $active_user_data[';username';]); if (!$user_id) { // prevent conflicts with Phorum user_ids by letting Phorum generate // its own user_id value. $active_user_data[';user_id';] = NULL; $user_id = phorum_api_user_save($active_user_data, PHORUM_FLAG_RAW_PASSWORD); }   // Load the existing user data. $phorum_user_data = phorum_api_user_get($user_id);   // If the user is not active, then do not log them in. if ($phorum_user_data[';active';] != PHORUM_USER_ACTIVE) { return $session_data; }   // Sync user data if any of the input fields is different from the // data that is stored for the Phorum user in the database. if ($active_user_data[';admin';] != $phorum_user_data[';admin';] || $active_user_data[';email';] != $phorum_user_data[';email';] || $active_user_data[';active';] != $phorum_user_data[';active';] || $active_user_data[';password';] != $phorum_user_data[';password';]) { $active_user_data[';user_id';] = $phorum_user_data[';user_id';]; phorum_api_user_save($active_user_data, PHORUM_FLAG_RAW_PASSWORD); }   // We have a legit user, so set the session info. $session_data[PHORUM_SESSION_LONG_TERM] = $user_id; $session_data[PHORUM_SESSION_SHORT_TERM] = $user_id;   return $session_data; } $session_data = inherit_authentication_from_session($session_data);

And it works perfectly on FF and Chrome. However, on safari and IE the session data is there when the forum opens, stays when going to list.php, but once in the thread list is no longer there for each thread (each thread link ends with read.php?3,4 instead of read.php?3,phorum_sesssion_v5...etc. like it does on chrome and FF)

What is the fix for this?

Re: Integration with current userbase not working in IE/Safari
October 20, 2012 05:23PM
This is a literal example that was written for somebody else's user session system. Are you using this exact file in your setup?

The session cookie should not be in the URL at all when using the user integration support. The fact that it does turn up in the URL makes me suspect that the integration solution is not working correctly here.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Integration with current userbase not working in IE/Safari
October 20, 2012 05:57PM
I have changed the session variables to match mine, as it works with no problems in chrome and FF (though apparently the session variables in the url is a problem).

I followed the steps in here:

Obviously all systems are different but what the OP wanted was exactly what I want (and since it works on a few browsers) I was correct. However there seems to be something missing/done wrong.
Sorry, only registered users may post in this forum.

Click here to login