{"id":8332,"date":"2022-06-13T14:45:23","date_gmt":"2022-06-13T14:45:23","guid":{"rendered":"http:\/\/phpcodez.com\/?p=8332"},"modified":"2022-06-13T14:45:23","modified_gmt":"2022-06-13T14:45:23","slug":"delete-cookie-javascript","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/delete-cookie-javascript\/","title":{"rendered":"Delete Cookie JavaScript"},"content":{"rendered":"<p>To delete a cookie, we can just set an expiration date and time. Specifying the correct path of the cookie that we want to delete is a good practice since some browsers won\u2019t allow the deletion of cookies unless there is a clear path that tells which cookie to delete from the user\u2019s machine.<\/p>\n<p>function delete_cookie(name) {<\/p>\n<p>document.cookie = name + &#8220;=; Path=\/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;&#8221;;<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To delete a cookie, we can just set an expiration date and time. Specifying the correct path of the cookie that we want to delete is a good practice since some browsers won\u2019t allow the deletion of cookies unless there is a clear path that tells which cookie to delete from the user\u2019s machine. function &hellip; <a href=\"http:\/\/phpcodez.com\/delete-cookie-javascript\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Delete Cookie JavaScript<\/span> <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":[12],"tags":[125,260],"class_list":["post-8332","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-cookie","tag-javascript"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/8332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=8332"}],"version-history":[{"count":1,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/8332\/revisions"}],"predecessor-version":[{"id":8333,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/8332\/revisions\/8333"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=8332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=8332"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=8332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}