{"id":667,"date":"2012-11-22T07:24:27","date_gmt":"2012-11-22T07:24:27","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=380"},"modified":"2012-11-22T07:24:27","modified_gmt":"2012-11-22T07:24:27","slug":"working-with-cookies-jquery","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/working-with-cookies-jquery\/","title":{"rendered":"Working with cookies jquery"},"content":{"rendered":"<p>Create session cookie<\/p>\n<pre>\n  $.cookie('CookieName', 'Value');\n<\/pre>\n<p>Cookie that Expires in 7 days<\/p>\n<pre>\n $.cookie('CookieName', 'Value', { expires: 7 });\n<\/pre>\n<p>Create cookie valid across entire site:<\/p>\n<pre>\n  $.cookie('CookieName', 'Value', { expires: 7, path: '\/' });\n<\/pre>\n<p>Read value cookie:<\/p>\n<pre>\n $.cookie('the_cookie'); \/\/ =&gt; \"the_value\"\n $.cookie('not_existing'); \/\/ =&gt; null\n<\/pre>\n<p>Delete cookie:<\/p>\n<pre>\n \/\/ Returns true when cookie was found, false when no cookie was found...\n $.removeCookie('the_cookie');\n\n \/\/ Same path as when the cookie was written...\n $.removeCookie('the_cookie', { path: '\/' });\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Create session cookie $.cookie(&#8216;CookieName&#8217;, &#8216;Value&#8217;); Cookie that Expires in 7 days $.cookie(&#8216;CookieName&#8217;, &#8216;Value&#8217;, { expires: 7 }); Create cookie valid across entire site: $.cookie(&#8216;CookieName&#8217;, &#8216;Value&#8217;, { expires: 7, path: &#8216;\/&#8217; }); Read value cookie: $.cookie(&#8216;the_cookie&#8217;); \/\/ =&gt; &#8220;the_value&#8221; $.cookie(&#8216;not_existing&#8217;); \/\/ =&gt; null Delete cookie: \/\/ Returns true when cookie was found, false when no cookie&hellip; <a href=\"https:\/\/codethataint.com\/blog\/working-with-cookies-jquery\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-667","post","type-post","status-publish","format-standard","hentry","category-jquery"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=667"}],"version-history":[{"count":0,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/667\/revisions"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}