Skip to content
Snippets Groups Projects
Verified Commit 481184f2 authored by Kent Richards's avatar Kent Richards :speech_balloon:
Browse files

Issue #2631220: Return FALSE from ::updateTimestamp


Per the issue queue comment #47.

Co-authored-by: default avatarznerol <46208-znerol@users.noreply.drupalcode.org>
parent 6f50e9f5
No related branches found
No related tags found
1 merge request!10482Issue #2631220: Apply changes from MR 2210 to 11.x
...@@ -149,22 +149,13 @@ public function gc(int $lifetime): int|false { ...@@ -149,22 +149,13 @@ public function gc(int $lifetime): int|false {
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* This function is intentionally a noop. Drupal uses a MetadataBag to manage
* session expiry.
*
* @see \Drupal\Core\Session\MetadataBag::__construct()
*/ */
public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool { public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool {
try {
return (bool) $this->connection->update('sessions')
->condition('sid', Crypt::hashBase64($sessionId))
->fields(['timestamp' => $this->time->getRequestTime()])
->execute();
}
// Swallow the error if the table hasn't been created yet.
catch (\Exception $e) {
if ($this->connection->schema()->tableExists('sessions')) {
// If the exception happened for other reason than the missing
// table, propagate the exception.
throw $e;
}
}
return FALSE; return FALSE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment