/**
* 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;
}