Endless jQuery cookie

I plan to use some kind of music on my site, but before I make it autostart for each visitor, I would like to see a warning immediately asking if they want to play music, or a little tip to present a message that you can check if you want music.

So, I know that I can set cookies through the cookie plugin , but I was wondering if I can set the time for cookies to be endless, in other words, never delete it unless the end user deletes all of their cookies or specific to my site .

Is this not considered acceptable use of cookies? If not, for such a task as you expect, should I install it?

+3
source share
1 answer

Something like 10 years is endless enough for this ever-changing web world;)

$.cookie('the_cookie', 'the_value', { expires: 365 * 10 });
+11
source

Source: https://habr.com/ru/post/1760847/


All Articles