C
C
Cucumbere2017-07-13 11:32:05
1C-Bitrix
Cucumbere, 2017-07-13 11:32:05

Why doesn't expires work in cookies?

The site has favorites, it has a counter and a link.
The link is stored in $.cookieStorage.
At

var storageCookie = $.cookieStorage;
function wishlistCookie(item) {
  if(storageCookie.isSet('wishlist_items.' + item)) {
    storageCookie.setPath('/').remove('wishlist_items.' + item);
  } else {
    storageCookie.setPath('/').set('wishlist_items.' + item, {expires= 7});

It is not possible to set the storage time, set by default as in the session.
How to fix, how to treat?
Google cookies say
Expiration date
When the browser session ends

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cucumbere, 2017-07-13
@Cucumbere

Written in a separate line

storageCookie.setPath('/').set('wishlist_items.' + item,"");
    storageCookie.setExpires(7)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question