MDL-46561 session: use full session validation in \core\session\manager::session_exists()
This commit is contained in:
@@ -82,19 +82,16 @@ class database extends handler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for existing session with id $sid.
|
||||
* Check the backend contains data for this session id.
|
||||
*
|
||||
* Note: this verifies the storage backend only, not the actual session records.
|
||||
* Note: this is intended to be called from manager::session_exists() only.
|
||||
*
|
||||
* @param string $sid
|
||||
* @return bool true if session found.
|
||||
*/
|
||||
public function session_exists($sid) {
|
||||
try {
|
||||
return $this->database->record_exists('sessions', array('sid'=>$sid, 'state'=>0));
|
||||
} catch (\dml_exception $ex) {
|
||||
return false;
|
||||
}
|
||||
// It was already checked in the calling code that the record in sessions table exists.
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user