public function SessionLimit::sessionDisconnect in Session Limit 8
Same name and namespace in other branches
- 2.x src/Services/SessionLimit.php \Drupal\session_limit\Services\SessionLimit::sessionDisconnect()
Disconnect a sessionId.
Parameters
string $sessionId: The session being disconnected
string $message: The logout message which must be already translated by this point
1 call to SessionLimit::sessionDisconnect()
- SessionLimit::_onSessionCollision__DropOldest in src/
Services/ SessionLimit.php - React to a session collision by dropping older sessions.
File
- src/
Services/ SessionLimit.php, line 334
Class
Namespace
Drupal\session_limit\ServicesCode
public function sessionDisconnect($sessionId, $message) {
$serialized_message = '';
if ($this
->hasMessageSeverity() && !empty($message)) {
$serialized_message = 'messages|' . serialize([
$this
->getMessageSeverity() => [
$message,
],
]);
}
$this->database
->update('sessions')
->fields([
'uid' => 0,
'session' => $serialized_message,
])
->condition('sid', $sessionId)
->execute();
// @todo add a watchdog log entry.
}