diff --git a/system/autoload/Admin.php b/system/autoload/Admin.php index 0b13542e..bbad49be 100644 --- a/system/autoload/Admin.php +++ b/system/autoload/Admin.php @@ -40,7 +40,7 @@ class Admin $isValid = self::validateToken($_SESSION['aid'], $_COOKIE['aid']); if (!$isValid) { self::removeCookie(); - _alert(Lang::T('Token has expired. Please log in again.'), 'danger', "admin"); + _alert(Lang::T('Token has expired. Please log in again.') . '.'.$_SESSION['aid'], 'danger', "admin"); return 0; } return $_SESSION['aid']; @@ -57,7 +57,7 @@ class Admin } if (!empty($_COOKIE['aid']) && !$isValid) { self::removeCookie(); - _alert(Lang::T('Token has expired. Please log in again.'), 'danger', "admin"); + _alert(Lang::T('Token has expired. Please log in again.') . '..', 'danger', "admin"); return 0; } else { if (time() - $tmp[1] < 86400 * 7) { @@ -124,7 +124,9 @@ class Admin 'samesite' => 'Lax', ]); session_destroy(); - unset($_COOKIE['aid']); + session_unset(); + session_start(); + unset($_COOKIE['aid'], $_SESSION['aid']); } } @@ -151,10 +153,10 @@ class Admin { global $config; $query = ORM::for_table('tbl_users')->select('login_token')->findOne($aid); - if($config['single_session'] != 'yes'){ + if ($config['single_session'] != 'yes') { return true; // For multi-session, any token is valid } - if(empty($query)){ + if (empty($query)) { return true; } return $query->login_token === sha1($cookieToken); diff --git a/system/lan/english.json b/system/lan/english.json index 6c50ec00..17775281 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -874,5 +874,6 @@ "Welcome_Message": "Welcome Message", "will_be_replaced_with_Customer_password": "will be replaced with Customer password", "will_be_replaced_with_Customer_Portal_URL": "will be replaced with Customer Portal URL", - "will_be_replaced_with_Company_Name": "will be replaced with Company Name" + "will_be_replaced_with_Company_Name": "will be replaced with Company Name", + "Token_has_expired__Please_log_in_again_": "Token has expired. Please log in again." } \ No newline at end of file diff --git a/ui/ui/customer/dashboard.tpl b/ui/ui/customer/dashboard.tpl index ae0b1001..9c0597ba 100644 --- a/ui/ui/customer/dashboard.tpl +++ b/ui/ui/customer/dashboard.tpl @@ -280,7 +280,7 @@ {/if}