{"id":184,"date":"2021-11-02T19:08:16","date_gmt":"2021-11-02T19:08:16","guid":{"rendered":"https:\/\/ouritsource.com\/blog\/?p=184"},"modified":"2021-11-02T20:35:00","modified_gmt":"2021-11-02T20:35:00","slug":"setting-and-reading-a-cookie-in-php","status":"publish","type":"post","link":"https:\/\/ouritsource.com\/blog\/setting-and-reading-a-cookie-in-php\/","title":{"rendered":"Setting and Reading a Cookie in PHP"},"content":{"rendered":"<body>\n<p>This code would create a cookie name myCookie with the value of \u201ctheValue\u201d. To retrieve the value of that cookie, one may  create a variable to retrieve the value of that cookie. For example:<\/p>\n\n\n\n<p>\/\/read cookie info<br>$cookie1=$_COOKIE[\u201cmyCookie\u201d];<br>Variable %cookie1 will provide the value of \u201ctheValue\u201d.<\/p>\n\n\n\n<div style=\"width:100%; padding-bottom:56.25%; position:relative;\">\n  <iframe src=\"https:\/\/www.ouritsource.com\/apps\/codingexamples\/showcode.php?ref=35\" style=\"position:absolute; top:0px; left:0px; \n  width:100%; height:100%; border: none; overflow: hidden;\"><\/iframe>\n<\/div>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>This code would create a cookie name myCookie with the value of \u201ctheValue\u201d. To retrieve the value of that cookie, one may create a variable to retrieve the value of that cookie&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-php","no-thumbnail"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":1,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/184\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}