Skip to content

Commit 481c431

Browse files
authored
Refactor: improve expiration time calculation using addSeconds()
Improve expiration time calculation using `addSeconds()`
1 parent 4d0b6e2 commit 481c431

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Authentication/Authenticators/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,9 @@ protected function rememberUser(User $user): void
927927

928928
private function calcExpires(): Time
929929
{
930-
$timestamp = Time::now()->getTimestamp() + setting('Auth.sessionConfig')['rememberLength'];
930+
$rememberLength = setting('Auth.sessionConfig')['rememberLength'];
931931

932-
return Time::createFromTimestamp($timestamp);
932+
return Time::now()->addSeconds($rememberLength);
933933
}
934934

935935
/**

0 commit comments

Comments
 (0)