Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Problem when trying to put or access multiple 'session' object. #22

Closed
SteveFidel opened this issue Jul 15, 2015 · 3 comments
Closed

Problem when trying to put or access multiple 'session' object. #22

SteveFidel opened this issue Jul 15, 2015 · 3 comments

Comments

@SteveFidel
Copy link

Hi,

I've got a weird issue while trying to set multiple session values using the latest release (2.0.1). My default driver option is 'local'.

So if I do the following:

locker.driver('session').put('sessionKey1', 1);
locker.driver('session').put('sessionKey2', 2);
locker.driver('local').put('localKey1', 1);
locker.driver('local').put('localKey2', 2);

"sessionKey1" is set as a SessionStorage, but all three others are set as LocalStorage. The problem here is that "sessionKey2" should have been a SessionStorage not LocalStorage.

But if I change the order like this:

locker.driver('session').put('sessionKey1', 1);
locker.driver('local').put('localKey1', 1);
locker.driver('session').put('sessionKey2', 2);
locker.driver('local').put('localKey2', 2);

Everything work as expected.

@tymondesigns
Copy link
Owner

Yea, I have just reproduced this. it was caused by this line - https://github.com/tymondesigns/angular-locker/blob/master/src/angular-locker.js#L632

Will release a patch release for this shortly

@SteveFidel
Copy link
Author

Great, thanks for your quick replies.... really appreciated :)

@tymondesigns
Copy link
Owner

done :) 2.0.2 should be available

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

No branches or pull requests

2 participants