From c831349dc55e2e8357127e47416b37780da4477d Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Thu, 25 Aug 2022 21:45:55 +0800 Subject: [PATCH] add log to userlogin() --- app/Http/Controllers/AuthenticateController.php | 2 +- include/constants.php | 2 +- include/functions.php | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AuthenticateController.php b/app/Http/Controllers/AuthenticateController.php index 3acf7bd1..392fff18 100644 --- a/app/Http/Controllers/AuthenticateController.php +++ b/app/Http/Controllers/AuthenticateController.php @@ -51,7 +51,7 @@ class AuthenticateController extends Controller $user = User::query()->where('passkey', $passkey)->first(['id', 'passhash']); if ($user) { $passhash = md5($user->passhash . $_SERVER["REMOTE_ADDR"]); - logincookie($user->id, $passhash,false,0x7fffffff, true, true, true); + logincookie($user->id, $passhash,false, 86400 * 30, true, true, true); $user->last_login = now(); $user->save(); } diff --git a/include/constants.php b/include/constants.php index d641ae1c..0a1a4681 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@