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

Session bag doesn't work with direct value assignments #2091

Closed
iby opened this issue Feb 25, 2014 · 2 comments
Closed

Session bag doesn't work with direct value assignments #2091

iby opened this issue Feb 25, 2014 · 2 comments

Comments

@iby
Copy link
Contributor

iby commented Feb 25, 2014

Ouch. This is a biggie:

$namespace = new Bag('Test');
$namespace->{'nonces'}[$nonce] = $value;

Nothing happens. If I add an extra line (I guess to explicitly set something and force it to save), then it stores x = y, and the values above.

$namespace = new Bag('Test');
$namespace->{'nonces'}[$nonce] = $value;
$namespace->set('x', 'y');
@iby
Copy link
Contributor Author

iby commented Feb 25, 2014

More to that, it seems to be failing only with nested values, e.g., when I do:

$namespace->{'x'} = 'y';

It works, but when I do:

$namespace->{'nonces'}[$nonce] = $value;

It stores Test in the $_SESSION as null. The current solution is to "manually" set it again after directly changing the values, which is a bitch.

$namespace->{'nonces'}[$nonce] = $value;
$namespace->set('nonces', $namespace->{'nonces'});

There's too much code to rewrite going forward with $namespace->set(…), can we please fix this? 😈

@iby iby mentioned this issue Feb 25, 2014
@iby
Copy link
Contributor Author

iby commented Feb 25, 2014

@sjinks, this is related to #1895. Didn't think to test the actual $_SESSION back then. But here we come…

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

2 participants