Fixed reported login problem ("PHP Warning: date() expects parameter 2 to be integer, float given")

This commit is contained in:
Bernd Bestel 2018-10-16 18:21:38 +02:00
parent 4a35477c35
commit 0e723a0a9b
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ class LoginController extends BaseController
if ($user !== null && password_verify($inputPassword, $user->password))
{
$sessionKey = $this->SessionService->CreateSession($user->id, $stayLoggedInPermanently);
setcookie($this->SessionCookieName, $sessionKey, time() + 31220640000); // Cookie expires in 999 years, but session validity is up to SessionService
setcookie($this->SessionCookieName, $sessionKey, intval(time() + 31220640000)); // Cookie expires in 999 years, but session validity is up to SessionService
if (password_needs_rehash($user->password, PASSWORD_DEFAULT))
{

View File

@ -37,10 +37,10 @@ class SessionService extends BaseService
{
$newSessionKey = $this->GenerateSessionKey();
$expires = date('Y-m-d H:i:s', time() + 2592000); // Default is that sessions expire in 30 days
$expires = date('Y-m-d H:i:s', intval(time() + 2592000)); // Default is that sessions expire in 30 days
if ($stayLoggedInPermanently === true)
{
$expires = date('Y-m-d H:i:s', time() + 31220640000); // 999 years aka forever
$expires = date('Y-m-d H:i:s', intval(time() + 31220640000)); // 999 years aka forever
}
$sessionRow = $this->Database->sessions()->createRow(array(