Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI_Session inconsistency #16

Open
n00dl3 opened this issue Nov 26, 2014 · 0 comments
Open

CI_Session inconsistency #16

n00dl3 opened this issue Nov 26, 2014 · 0 comments

Comments

@n00dl3
Copy link

n00dl3 commented Nov 26, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant