-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Expired cookie is still present in document.cookie #1027
Comments
Seems like jsdom's cookies mechanism doesn't meet RFC 6265. Maybe we should adopt https://github.com/goinstant/tough-cookie? I can take care of it somewhere around next week. /cc @domenic @Sebmaster |
I had a look at though-cookie once already, but as far as I remember there was something else missing or not compliant, however I currently can't remember exactly what it was. I'll take another look. |
We use it currently heavily in production and haven't encountered any problems on Alexa top 500 websites. |
I found test suite for the HTTP-state: https://github.com/abarth/http-state/tree/master/tests I'll try to run it against tough-cookie on weekend. If we will have something missing/broken I can take care of PR/fork. |
Would love to farm out cookie handling to another module. Happy to take anyone's patches that does that :). Either that or we can keep patching our current implementation. Also worth checking out: https://github.com/assaf/zombie/blob/master/src/cookies.js |
Oh and feel free to create the module under github.com/jsdom, I can add you to it as a collaborator if you want. (You don't have to though.) |
@domenic I hope we will be able to end up with the tough-cookie, without dealing with new module.
I hope I will be able to start tomorrow, I need to rollout pending updates to parse5 first. |
Sounds like a lovely plan <3. |
Ooook, we have 71 failing tests from the IETF's suite at the moment (Vows reporter is extremely shitty BTW). Moreover IETF data is a little bit obsolete. I'll issue them a PR with the update tool once I finish fixing current failing tests. Seems like It will be a looong road 🔨 |
I've fixed all issues in tough cookie and issued them a PR (salesforce/tough-cookie#30). Now we can move to the jsdom part. |
@domenic I have a question. My first intention was to move
Meanwhile, |
@inikulin cooke is in the HTML Standard now, which supplements the DOM Standard. We don't have a clear division between HTML and DOM in living/, and I'm not sure we want or need one. So living/document.js is fine, or maybe living-html/document.js |
Thank you fo the clarification, found them in the HTML Standard. |
Thanks everyone! |
jsdom version: 3.1.1
I ran into a bug that is alluded to in #310 and referenced in ScottHamper/Cookies#37 and jamesplease/backbone.simple-auth#1: A cookie set with an expiration date in the past -- as recommended on MDN as the way to delete a cookie -- is still present in
document.cookie
inside jsdom.jsdom test case:
This results in the following output:
Here is a browser test case:
The output is as expected:
The text was updated successfully, but these errors were encountered: