K
K
kimqar2020-05-08 17:57:10
JavaScript
kimqar, 2020-05-08 17:57:10

How to save cookies in the root of the site?

There is a function that writes cookies on click:

$('.versions-site__header a').click(function(event) {
    $.cookie('special-settings', 'open');
    
});

The only problem is that if I go to some subsection of the menu (for example, Home / about the company), then this cookie will not be there. As I understand it, the problem is that the cookie is not stored in the root of the site. How to make it visible on all subsections of the site? (If it helps, then the site on ModX)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2020-05-08
@ThunderCat

RTFM
https://github.com/carhartl/jquery-cookie#readme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question