I have a simple jQuery function creating a cookie (and yes I am including the plugin), I can get the script to create a cookie using:
$.cookies.set('LastArticle', $(this).attr("id"), { expires: 1 } );
But the created cookie (in multiple browsers) is only a session cookie with no expire date.
I tried just using the more simple:
$.cookie('TEST_COOKIE2', 2, {expires: 30});
Test page: http://www.armorama.com/test2.php
and that produces NO COOKIE at all. What is wrong?
You are getting “TypeError: $.cookie is not a function” error. Try using the document ready function:
Also, I think you are mixing up jQuery Cookie scripts. The one you are using http://code.google.com/p/cookies/, does not set cookies this way. You need to use the $.cookie.set as $.cookie is not a function.
The Expires option is expiresAt, so should be: