You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
first : nice job, these classes were very helpful 👍
I had a problem with the session class due to its re-instanciation.
Let's say I have a parent controller calling several children controllers (ctrl_a & ctrl_b).
if you load the session library in ctrl_a and set data in it : $this->session->set_userdata('arbitrary_key_a','arbitrary_value_a');
then in the ctrl_b you load session library and once more add data : $this->session->set_userdata('arbitrary_key_b','arbitrary_value_b');
Only the datas saved in ctrl_b will persist because the session library is not a singleton !
So I had to override the CI_Session class, modify the $userdata property and set it to static and force sess_read to merge the cookie's data to the static $userdata array.
The text was updated successfully, but these errors were encountered:
Hello,
first : nice job, these classes were very helpful 👍
I had a problem with the session class due to its re-instanciation.
Let's say I have a parent controller calling several children controllers (ctrl_a & ctrl_b).
if you load the session library in ctrl_a and set data in it :
$this->session->set_userdata('arbitrary_key_a','arbitrary_value_a');
then in the ctrl_b you load session library and once more add data :
$this->session->set_userdata('arbitrary_key_b','arbitrary_value_b');
Only the datas saved in ctrl_b will persist because the session library is not a singleton !
So I had to override the CI_Session class, modify the $userdata property and set it to static and force sess_read to merge the cookie's data to the static $userdata array.
The text was updated successfully, but these errors were encountered: