views:

51

answers:

1

Hey,

I plan to use some music on my site, but before I make it autoplay for each visitor, I would like to have either an alert pop up immediately, asking if they would like the music to play, or a nice little tooltip of some sort to present a message stating that you can check whether or not you would like the music.

So, I know I can set a cookie via the cookie plugin but I was wondering if I could set the cookie's time to infinite, in other words, never to delete it, unless the end-user deletes all of their cookies, or the specific one for my site.

Is this not considered a valid use of cookies? If not, for a task like this, what should time do you suggest I set it to?

+2  A: 

Something like 10 years is infinite enough for this ever-changing web realm ;)

$.cookie('the_cookie', 'the_value', { expires: 365 * 10 });
Lukman
I don't know, they remember my site after 10 years, and want to come back! :D OK, thanks!
BOSS