mainmatter / ember-cookies

Cookies abstraction for Ember.js that works both in the browser as well as with Fastboot on the server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear method drops any options that are passed to it

MooreJesseB opened this issue · comments

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

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.