Skip to content

Clarify the behavior for the domain attribute #87

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

Closed
FagnerMartinsBrack opened this issue Sep 13, 2015 · 3 comments
Closed

Clarify the behavior for the domain attribute #87

FagnerMartinsBrack opened this issue Sep 13, 2015 · 3 comments
Assignees
Milestone

Comments

@FagnerMartinsBrack
Copy link
Member

Perhaps we should mention in the "domain" attribute section of the README more details on how the sub-domain syntax works according to the spec. See #81.

@FagnerMartinsBrack FagnerMartinsBrack added this to the v2.0.4 milestone Sep 13, 2015
This was referenced Sep 13, 2015
@vemv-kantox
Copy link

Could be a good idea. Few programmers are going to read an RFC. js-cookie is in a position of trust to present us a distilled version of cookie behavior!

@FagnerMartinsBrack
Copy link
Member Author

I believe changing the docs by including "subdomain" instead of "domain" fixes most confusion about the domain attribute:

A String indicating a valid subdomain where the cookie is visible.

A domain doesn't make sense (the domain cannot be changed), so it makes sense documenting that it accepts only a subdomain of the current domain. I believe this is an interpretation confusion, where the docs assumes that a subdomain is also a domain.

It can be more specific like:

A String indicating a valid subdomain where the cookie is visible. For security reasons, only subdomains of the current page are allowed.

FagnerMartinsBrack added a commit that referenced this issue Sep 19, 2015
Provide more information regarding the common formats for the "domain" attribute.

Closes gh-87. Related to gh-81.
@FagnerMartinsBrack
Copy link
Member Author

#91

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

No branches or pull requests

2 participants