Session lost after refresh page! |
Hi,
my problem with CI4 is that session not working after I refresh page. I load session in BasicController but it nothing change. Please help me.
i don't think anybody can help with this since there is not enough information to go on.
Maybe you post your code your playing with in the controller , but as a starter ..in every controller involved in a session , my approach is to put session_start(); //at the start might not be the best approach but works for me public function credentials() { session_start(); (07-01-2020, 08:48 AM)captain-sensible Wrote: i don't think anybody can help with this since there is not enough information to go on.I have same mistake. In login Controller Quote:$this->session->set($data['user']); But after redirect, session is null. Thank you for your help!.
In the 'receiving' controller, try inserting this somewhere at the top:
Code: $this->session = \Config\Services::session();
Or use the session helper it is changeable.
PHP Code: $data = [ Either way you are not assigning a value to $data['user'] What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |