Skip to content

Commit

Permalink
Fix expired message
Browse files Browse the repository at this point in the history
Aaron had a session, and upgraded Chrome before the session expired.
Then his session was stuck because of the browser agent check that
did not wipe out the session data when it found a mismatch.
  • Loading branch information
csev committed Apr 22, 2018
1 parent dcf76f2 commit 65f27b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Core/LTIX.php
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,7 @@ public static function requireDataPrivate($needed=self::ALL,
// So it is just a warning - nothing much we can do except tell them.
if ( count($needed) > 0 && self::wrapped_session_get($session_object, 'lti',null) === null ) {
self::send403(); error_log('Session expired - please re-launch '.session_id());
self::wrapped_session_flush($session_object);
die('Session expired - please re-launch'); // with error_log
}

Expand All @@ -1332,6 +1333,7 @@ public static function requireDataPrivate($needed=self::ALL,
if ( (!isset($_SERVER['HTTP_USER_AGENT'])) ||
$_SERVER['HTTP_USER_AGENT'] != $session_agent ) {
self::send403();
self::wrapped_session_flush($session_object);
self::abort_with_error_log("Session has expired", " ".session_id()." HTTP_USER_AGENT ".
(($session_agent !== null ) ? $session_agent : 'Empty Session user agent') .
' ::: '.
Expand Down

0 comments on commit 65f27b3

Please sign in to comment.