Clear method drops any options that are passed to it
MooreJesseB opened this issue · 1 comments
MooreJesseB commented
The clear
method seems to be dropping any options, specifically path
, that are passed to it.
It does successfully set the expires
option and passes it on the write
method but, in my case, path
is not getting passed on to the write
method.
I am able to work around it by just calling the write
method and setting the expire
option as clear
does, and write
still accepts my desired path
; However, it would be desirable if clear
functioned as described in the documentation.
- Thanks
geekygrappler commented
Hi,
We checked this and it now works.
it('clears the cookie set for a given path', function() {
let path = document.location.pathname;
let value = randomString();
this.subject().write(COOKIE_NAME, value, { path });
expect(this.subject().read(COOKIE_NAME)).to.eq(value);
this.subject().clear(COOKIE_NAME, { path });
expect(this.subject().read(COOKIE_NAME)).to.be.undefined;
});
That's the test.