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

Memory session adapter and dotted keys #1220

Open
fedeisas opened this issue Dec 2, 2015 · 2 comments
Open

Memory session adapter and dotted keys #1220

fedeisas opened this issue Dec 2, 2015 · 2 comments

Comments

@fedeisas
Copy link

fedeisas commented Dec 2, 2015

Hi! I found a bug when using memory session adapter. I use in-memory session when running unit tests and they were failing.

use lithium\storage\Session;
use lithium\storage\session\adapter\Memory;
use lithium\storage\session\adapter\Php;

Session::config([
    'default' => ['adapter' => new Php()],
    'memory' => ['adapter' => new Memory()]
]);

Session::write('a.b', ['my' => 'data'], ['name' => 'default']);
var_dump(Session::read('a', ['name' => 'default']));
// array (size=1)
//  'b' => 
//    array (size=1)
//      'my' => string 'data' (length=4)

Session::write('a.b', ['my' => 'data'], ['name' => 'memory']);
var_dump(Session::read('a', ['name' => 'memory']));
// null

I think both adapters should have the same behavior regarding dotted keys.

@mariuswilms
Copy link
Member

You're right this should be changed. I've labelled this as an enhancement as it does not prevent the core framework from working correctly.

@fedeisas
Copy link
Author

fedeisas commented Dec 2, 2015

Ok.

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

No branches or pull requests

2 participants