diff --git a/app/Controllers/LoginController.php b/app/Controllers/LoginController.php index 73f7bb0..9257f5f 100755 --- a/app/Controllers/LoginController.php +++ b/app/Controllers/LoginController.php @@ -48,11 +48,11 @@ class LoginController extends BaseController // dd($user_team); session()->regenerate(true); $session_data = [ - 'isLoggedIn' => True , - 'userid' => $user->id, - 'userData' => $user, - 'userProfile' => $value->picture, - 'user_team' => $user_team, + 'pre_isLoggedIn' => True , + 'pre_userid' => $user->id, + 'pre_userData' => $user, + 'pre_userProfile' => $value->picture, + 'pre_user_team' => $user_team, ]; $path = getenv('cookie.Path'); $domain = getenv('cookie.Domain'); diff --git a/app/Helpers/session_helper.php b/app/Helpers/session_helper.php index ccbdd51..4d2bce3 100755 --- a/app/Helpers/session_helper.php +++ b/app/Helpers/session_helper.php @@ -41,7 +41,7 @@ if (!function_exists('check_session')) { { // $ci =& get_instance(); $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() { $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(); // 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 if ($lastVisitTime) { @@ -81,7 +81,7 @@ if (!function_exists('get_session_userid')) { { // $ci =& get_instance(); $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(); $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(); $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(); $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(); $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) { $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() { $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(); $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(); $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(); $session = \Config\Services::session(); - return $session->get('user_team'); + return $session->get('pre_user_team'); } } diff --git a/tests/session/ExampleSessionTest.php b/tests/session/ExampleSessionTest.php index 98fe7af..abc5fd4 100755 --- a/tests/session/ExampleSessionTest.php +++ b/tests/session/ExampleSessionTest.php @@ -12,7 +12,7 @@ final class ExampleSessionTest extends CIUnitTestCase { $session = Services::session(); - $session->set('logged_in', 123); - $this->assertSame(123, $session->get('logged_in')); + $session->set('pre_logged_in', 123); + $this->assertSame(123, $session->get('pre_logged_in')); } }