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

Cookie domain validation rule on client side is strange #1702

Closed
b12031106 opened this issue Jul 28, 2018 · 1 comment
Closed

Cookie domain validation rule on client side is strange #1702

b12031106 opened this issue Jul 28, 2018 · 1 comment
Assignees
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug

Comments

@b12031106
Copy link
Contributor

for example,

if current domain is https://www.google.com,
and you try set cookie with domain .google.com

document.cookie = 'a=b; domain=.google.com;';

In normal browser, this code is working fine,
I can get this cookie value by access document.cookie,

but in Testcafe browser, this code is not working,
and I find out maybe is because client side cookie validation is strange:

https://github.com/DevExpress/testcafe-hammerhead/blob/master/src/client/sandbox/cookie/index.js#L85

return !parsedCookie.domain || parsedDestLocation.hostname === parsedCookie.domain;

this line means that when you set a cookie with domain attribute,
it should be exactly the same with current hostname,
but this behavior is different to a normal browser.

b12031106 added a commit to b12031106/testcafe-hammerhead that referenced this issue Jul 28, 2018
b12031106 added a commit to b12031106/testcafe-hammerhead that referenced this issue Jul 28, 2018
@LavrovArtem LavrovArtem self-assigned this Jul 30, 2018
@LavrovArtem LavrovArtem added this to the Sprint #15 milestone Jul 30, 2018
LavrovArtem pushed a commit to LavrovArtem/testcafe-hammerhead that referenced this issue Aug 3, 2018
miherlosev pushed a commit that referenced this issue Aug 3, 2018
* fix client cookie domain attribute validation issue (#1702)

* refactor code and add tests

* change function's name
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this issue Feb 28, 2019
…DevExpress#1703)

* fix client cookie domain attribute validation issue (DevExpress#1702)

* refactor code and add tests

* change function's name
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked Issues that were automatically locked by the Lock bot label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: client STATE: Auto-locked Issues that were automatically locked by the Lock bot TYPE: bug
Projects
None yet
Development

No branches or pull requests

2 participants