From 481c43168784d783ff93f3543fcf4f1f2492254b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 28 Feb 2025 01:53:07 +0330 Subject: [PATCH] Refactor: improve expiration time calculation using `addSeconds()` Improve expiration time calculation using `addSeconds()` --- src/Authentication/Authenticators/Session.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Authentication/Authenticators/Session.php b/src/Authentication/Authenticators/Session.php index 31836a631..1d3f7886c 100644 --- a/src/Authentication/Authenticators/Session.php +++ b/src/Authentication/Authenticators/Session.php @@ -927,9 +927,9 @@ protected function rememberUser(User $user): void private function calcExpires(): Time { - $timestamp = Time::now()->getTimestamp() + setting('Auth.sessionConfig')['rememberLength']; + $rememberLength = setting('Auth.sessionConfig')['rememberLength']; - return Time::createFromTimestamp($timestamp); + return Time::now()->addSeconds($rememberLength); } /**