I am using this code to create a cookie with JQuery:
$.cookie('MyCookieName', 'myValueHere');
It works fine but as I have the value assign to a random number it’s generating a new one every reload.
What I need to do is check if cookie has a value and if it’s not empty then don’t create a new one or generate any new value.
You can also add expire time and path in options.
Then you can be sure, that cookies won’t be deleted.