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 defective jquery.cookie invocation #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix defective jquery.cookie invocation #41

wants to merge 1 commit into from

Conversation

znerol
Copy link

@znerol znerol commented Feb 20, 2014

  • The $.cookie function expects the domain, expires and path
    options as one object as the third parameter, not as individual
    parameters.
  • The domain option should be left empty when the cookie is set
    for the current domain. Passing document.location.hostname does not
    work always (e.g. on localhost).
  • Reading all cookies was introduced with jquery.cookie v1.3.0. On older
    websites / CMSes this feature is not available. Therefore let's just
    simply remove getPermaOptions and call jquery.cookie directly from
    within getPermaOption.

* The $.cookie function expects the `domain`, `expires` and `path`
  options as one object as the third parameter, not as individual
  parameters.
* The `domain` option should be left empty when the cookie is set
  for the current domain. Passing `document.location.hostname` does not
  work always (e.g. on localhost).
* Reading all cookies was introduced with jquery.cookie v1.3.0. On older
  websites / CMSes this feature is not available. Therefore let's just
  simply remove `getPermaOptions` and call jquery.cookie directly from
  within `getPermaOption`.
@panzi
Copy link
Owner

panzi commented Feb 20, 2014

I use this jQuery cookie plugin: https://github.com/panzi/jQuery-Cookies (as stated in the dependencies)

@znerol
Copy link
Author

znerol commented Feb 21, 2014

Oh, this is bad. Because everyone else uses http://plugins.jquery.com/cookie/

@panzi
Copy link
Owner

panzi commented Feb 21, 2014

Yeah, I guess I have to switch to that.

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