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

Fix cookie not being parsed on load. #1

Merged
merged 1 commit into from
Apr 19, 2015

Conversation

pixeleet
Copy link

If you have to stringify your object before saving, and you add that,
to the _cookies cache, then you'll return that on load after setting
it with save.

While if the value is already set, the script correctly parses the cookie
values and what you load is returned as an object.

This oneliner takes care of that for you.

If you have to stringify your object before saving, and you add that,
to the `_cookies` cache, then you'll return that on `load` after setting
it with `save`.

While if the value is already set, the script correctly parses the cookie
values and what you load is returned as an object.

This oneliner takes care of that for you.
eXon added a commit that referenced this pull request Apr 19, 2015
Fix cookie not being parsed on load.
@eXon eXon merged commit 45a62ad into bendotcodes:master Apr 19, 2015
@eXon
Copy link
Collaborator

eXon commented Apr 19, 2015

You are absolutely right. Nice catch 👍

@pixeleet
Copy link
Author

Thanks. Can you publish the changes on npm too please? ;)

@eXon
Copy link
Collaborator

eXon commented Apr 19, 2015

Will be done in the upcoming days once I'm sure their is no issues with this

@pixeleet
Copy link
Author

From the top of my head. If you send in a stringified object, then when you
load it you get that back, which is fine, but when you reload you'll get it
parsed as an object. You might want to make automagic parsing optional.

Also, right now you don't expose any API for deleting a cookie.

2015-04-19 19:37 GMT+02:00 Benoit Tremblay [email protected]:

Will be done in the upcoming days once I'm sure their is no issues with
this


Reply to this email directly or view it on GitHub
#1 (comment).

@eXon
Copy link
Collaborator

eXon commented Apr 20, 2015

You can now update to 0.1.8 :)

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

Successfully merging this pull request may close these issues.

2 participants