GWM : session key changed

This commit is contained in:
Gowtham M 2026-05-19 10:34:32 +05:30
parent 6a9eee81d3
commit b1ce8c3d49
3 changed files with 20 additions and 20 deletions

View File

@ -48,11 +48,11 @@ class LoginController extends BaseController
// dd($user_team); // dd($user_team);
session()->regenerate(true); session()->regenerate(true);
$session_data = [ $session_data = [
'isLoggedIn' => True , 'pre_isLoggedIn' => True ,
'userid' => $user->id, 'pre_userid' => $user->id,
'userData' => $user, 'pre_userData' => $user,
'userProfile' => $value->picture, 'pre_userProfile' => $value->picture,
'user_team' => $user_team, 'pre_user_team' => $user_team,
]; ];
$path = getenv('cookie.Path'); $path = getenv('cookie.Path');
$domain = getenv('cookie.Domain'); $domain = getenv('cookie.Domain');

View File

@ -41,7 +41,7 @@ if (!function_exists('check_session')) {
{ {
// $ci =& get_instance(); // $ci =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('isLoggedIn'); return $session->get('pre_isLoggedIn');
} }
} }
@ -49,7 +49,7 @@ if (!function_exists('set_last_visited_time')) {
function set_last_visited_time() function set_last_visited_time()
{ {
$session = \Config\Services::session(); $session = \Config\Services::session();
$session->set('last_visited', date("Y-m-d H:i:s")); $session->set('pre_last_visited', date("Y-m-d H:i:s"));
} }
} }
@ -60,7 +60,7 @@ if (!function_exists('get_last_visited_time')) {
$session = \Config\Services::session(); $session = \Config\Services::session();
// Get the last visited time from session // Get the last visited time from session
$lastVisitTime = $session->get('last_visited'); $lastVisitTime = $session->get('pre_last_visited');
// Check if the last visited time is set // Check if the last visited time is set
if ($lastVisitTime) { if ($lastVisitTime) {
@ -81,7 +81,7 @@ if (!function_exists('get_session_userid')) {
{ {
// $ci =& get_instance(); // $ci =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('userid'); return $session->get('pre_userid');
} }
} }
@ -90,7 +90,7 @@ if (!function_exists('get_session_userdata')) {
{ {
// $ci =& get_instance(); // $ci =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('userData'); return $session->get('pre_userData');
} }
} }
@ -99,7 +99,7 @@ if (!function_exists('get_userProfile')) {
{ {
// $ci =& get_instance(); // $ci =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('userProfile'); return $session->get('pre_userProfile');
} }
} }
@ -108,7 +108,7 @@ if (!function_exists('get_session_user')) {
{ {
// $ci =& get_instance(); // $ci =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('isLoggedIn'); return $session->get('pre_isLoggedIn');
} }
} }
@ -128,7 +128,7 @@ if (!function_exists('check_permission')) {
{ {
// $ci =& get_instance(); // $ci =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('role'); return $session->get('pre_role');
} }
} }
@ -136,7 +136,7 @@ if (!function_exists('set_session_uuid')) {
function set_session_uuid($uuid) function set_session_uuid($uuid)
{ {
$session = \Config\Services::session(); $session = \Config\Services::session();
$session->set('uuid', $uuid); $session->set('pre_uuid', $uuid);
} }
} }
@ -144,7 +144,7 @@ if (!function_exists('get_session_uuid')) {
function get_session_uuid() function get_session_uuid()
{ {
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('uuid'); return $session->get('pre_uuid');
} }
} }
@ -163,7 +163,7 @@ if (!function_exists('set_session_context')) {
{ {
// $CI =& get_instance(); // $CI =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
$session->set('context',$context); $session->set('pre_context',$context);
} }
} }
@ -172,7 +172,7 @@ if (!function_exists('get_session_context')) {
{ {
// $CI =& get_instance(); // $CI =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('context'); return $session->get('pre_context');
} }
} }
@ -181,6 +181,6 @@ if (!function_exists('user_team')) {
{ {
// $CI =& get_instance(); // $CI =& get_instance();
$session = \Config\Services::session(); $session = \Config\Services::session();
return $session->get('user_team'); return $session->get('pre_user_team');
} }
} }

View File

@ -12,7 +12,7 @@ final class ExampleSessionTest extends CIUnitTestCase
{ {
$session = Services::session(); $session = Services::session();
$session->set('logged_in', 123); $session->set('pre_logged_in', 123);
$this->assertSame(123, $session->get('logged_in')); $this->assertSame(123, $session->get('pre_logged_in'));
} }
} }