Skip to content
Browse files

mnet: fix SSO breakage if the same user was using multiple browsers

  • Loading branch information...
1 parent 77ea333 commit 4e04772745b977b9011ea6c92e374cc2baf8fc31 martinlanghoff committed Jan 24, 2007
Showing with 10 additions and 3 deletions.
  1. +10 −3 auth/mnet/auth.php
View
13 auth/mnet/auth.php
@@ -198,7 +198,10 @@ function start_jump_session($mnethostid, $wantsurl) {
$mnet_peer->set_id($mnethostid);
// set up the session
- $mnet_session = get_record('mnet_session', 'userid', $USER->id, 'mnethostid', $mnethostid, 'useragent', sha1($_SERVER['HTTP_USER_AGENT']));
+ $mnet_session = get_record('mnet_session',
+ 'userid', $USER->id,
+ 'mnethostid', $mnethostid,
+ 'useragent', sha1($_SERVER['HTTP_USER_AGENT']));
if ($mnet_session == false) {
$mnet_session = new object();
$mnet_session->mnethostid = $mnethostid;
@@ -376,14 +379,18 @@ function confirm_mnet_session($token, $remotewwwroot) {
}
// set up the session
- $mnet_session = get_record('mnet_session', 'userid', $localuser->id, 'mnethostid', $remotepeer->id, 'useragent', sha1($_SERVER['HTTP_USER_AGENT']));
+ $mnet_session = get_record('mnet_session',
+ 'userid', $localuser->id,
+ 'mnethostid', $remotepeer->id,
+ 'useragent', sha1($_SERVER['HTTP_USER_AGENT']));
if ($mnet_session == false) {
$mnet_session = new object();
$mnet_session->mnethostid = $remotepeer->id;
$mnet_session->userid = $localuser->id;
$mnet_session->username = $localuser->username;
$mnet_session->useragent = sha1($_SERVER['HTTP_USER_AGENT']);
- $mnet_session->token = ''; //Not needed on the SP side
+ $mnet_session->token = $token; // Needed to support simultaneous sessions
+ // and preserving DB rec uniqueness
$mnet_session->confirm_timeout = time();
$mnet_session->expires = time() + (integer)$session_gc_maxlifetime;
$mnet_session->session_id = session_id();

0 comments on commit 4e04772

Please sign in to comment.
Something went wrong with that request. Please try again.