/** * Load a session from the data store. * * @param string|null $sessionId The ID of the session we should load, or null to use the default. * * @return SimpleSAML_Session|null The session object, or null if it doesn't exist. */ public function loadSession($sessionId = null) { assert('is_string($sessionId) || is_null($sessionId)'); if ($sessionId === null) { $sessionId = $this->getCookieSessionId(); } $session = $this->store->get('session', $sessionId); if ($session !== null) { assert('$session instanceof SimpleSAML_Session'); return $session; } return null; }
/** * Retrieve all session IDs from a key-value store. * * @param SimpleSAML_Store_SQL $store The datastore. * @param string $authId The authsource ID. * @param string $nameId The hash of the users NameID. * @param array $sessionIndexes The session indexes. * @return array Associative array of SessionIndex => SessionId. */ private static function getSessionsStore(SimpleSAML_Store $store, $authId, $nameId, array $sessionIndexes) { assert('is_string($authId)'); assert('is_string($nameId)'); $res = array(); foreach ($sessionIndexes as $sessionIndex) { $sessionId = $store->get('saml.LogoutStore', $nameId . ':' . $sessionIndex); if ($sessionId === NULL) { continue; } assert('is_string($sessionId)'); $res[$sessionIndex] = $sessionId; } return $res; }