opened
garmgrey
username_0
Hello. 
I have some issue with dublicating cookie entries.
Some time, when i call 
```javascript
Cookies.set('my-cookie-name', 'value', {'path': '/'});
```

I am sure that I call this method only one place in my code, but in result I have:

```
---------------------------------------------------------------
    Name               Value     Domain              Path
---------------------------------------------------------------
    my-cookie-name     1         mydomain.com        /foo/bar/
    my-cookie-name     value     mydomain.com        /
---------------------------------------------------------------
```

This does not happen every time.
Duplicated cookie entries
issue
created
FagnerMartinsBrack
username_1
Even though you call it once, the user could already have a cookie locally. Changing the code does not delete a cookie that was persisted earlier.

Another theory is that you might be passing an Object Literal reference in the `attributes` argument, then another code change the Object and the cookie is created with another `Path`.

Anyway, it's pretty hard to figure out the problem without a reduced test case.
comment
created
gcollombet
username_2
I have the same problem. I call 
  Cookies.set('my-cookie-name', 'value');
from a single location but it create me two cookie with same name one with / and one with my page requested uri.
comment
created
garmgrey
username_0
@username_2 That is why I use the attribute {path: '/'}. But this does not solve the problem.

@username_1 Cookie with name ```'my-cookie-name'``` sets in only one place of code.
This issue i catch on my dev machine, so it can't be a old (or wrong) cookie.
But i use it for toggle some state. i mean like this:
```javascript
var state = 'on';
$elem.on('click', function(e){
    state = state === 'on' ? 'off' : 'on';
    Cookies.set('my-cookie-name', state, {path: '/'});
});
```

May be it's wrong usage? And i need to remove old cookie before set new value?
comment
created
FagnerMartinsBrack
username_1
@username_0 
If you remove the cookie before setting the value it works?
What is the output of `Cookies.set()` operation in all calls? Can you put a `console.log` there?
comment
created
garmgrey
username_0
@username_1 This problem occurs rarely, so it is difficult to catch. At this moment i remove cookie before set new value and do not catch the problem again. But i think it is wrong usage of ```js-cookie``` lib.

Do you mean this?
```javascript
console.log(Cookies.set('my-cookie-name', state, {path: '/'}));
```
comment
created
gcollombet
username_2
Ok sorry,  in my case it was a the server part that add the wrong cookie
(I'll do a setcookie in php... ).
comment
created
FagnerMartinsBrack
username_1
If you have any questions regarding js-cookie usage you can use the [`js-cookie`](http://stackoverflow.com/questions/tagged/js-cookie) tag on stackoverflow. The benefit of asking there is that it has better PageRank for Google and therefore has a greater chance to help somebody else in the future ;)

If you ask on StackOverflow please link here to increase awareness.
comment
created
garmgrey
username_0
@username_1 @username_2 
Thank you. I will write here when I find an answer...
comment
created
garmgrey
username_0
@username_1 [Question on StackOverflow](http://stackoverflow.com/questions/33011827/excess-record-in-cookies)
comment
created
FagnerMartinsBrack
username_1
I will close this for now since it doesn't seems to be any `js-cookie` internal problem.
comment
closed
FagnerMartinsBrack
username_1
issue