{"id":2786,"date":"2020-08-18T18:00:56","date_gmt":"2020-08-18T16:00:56","guid":{"rendered":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/?p=2786"},"modified":"2022-10-20T11:42:37","modified_gmt":"2022-10-20T09:42:37","slug":"what-is-a-cookie-in-php","status":"publish","type":"post","link":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/","title":{"rendered":"what is a cookie in php"},"content":{"rendered":"\n<p class=\"has-medium-font-size wp-block-paragraph\">In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: <strong>PHP.<\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">In questo articolo:<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#What_is_a_cookie\" >1. What is a cookie<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#How_to_set_a_cookie_in_PHP\" >2. How to set a cookie in PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#Access_to_cookie_value\" >3. Access to cookie value<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#Removal_of_cookie\" >4. Removal of cookie<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_a_cookie\"><\/span><strong><strong>What is a cookie<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">A cookie is nothing more than a small text file that allows you to store a small amount of data (approximately 4 KB) on the user&#8217;s computer. They are typically used to keep track of information such as the username that the site can retrieve to personalize the page when the user visits the site for the next time.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Therefore, every time the browser makes a new request to the server, all cookie data is automatically sent to the server within the request itself.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_set_a_cookie_in_PHP\"><\/span><strong><strong>How to set a cookie in PHP<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The setcookie () function is used to set and create a cookie in PHP. Make sure you call this function before generating or outputting your script otherwise the cookie will not be set. The basic syntax of this function is:<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><em><strong>setcookie&nbsp;(&nbsp;name&nbsp;,&nbsp;value&nbsp;,&nbsp;expires&nbsp;,&nbsp;path&nbsp;,&nbsp;domain&nbsp;,&nbsp;secure&nbsp;);<\/strong><\/em><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The setcookie () parameters can be summarized as follows:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><td><strong>Parameter<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><\/thead><tbody><tr><td>name<\/td><td>The name of the cookie.<\/td><\/tr><tr><td>Value<\/td><td>The value of the cookie. Do not store sensitive information as this value is stored in the computer of the user, and consequently this data could be read by malicious people.<\/td><\/tr><tr><td>expires<\/td><td>The expiration date in UNIX timestamp format. After this time the cookies will become inaccessible, i.e. the value of a cookie will no longer be readable. Therefore its default value will be 0.<\/td><\/tr><tr><td>Path<\/td><td>Specify the path on the server for which the cookie will be available. If set to \/, the cookie will be available within the entire domain. Therefore, each script, present within the domain, will be able to retrieve and exploit the value of the cookie.<\/td><\/tr><tr><td>Domain<\/td><td>Specify the domain for which the cookie is available, for example www.example.com.<\/td><\/tr><tr><td>Secure<\/td><td>This field, if present, indicates that the cookie should only be sent if a connection exists Secure HTTPS.<\/td><\/tr><\/tbody><\/table><figcaption>Parameters function setcookie<\/figcaption><\/figure>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Please note that if the cookie expiration date is omitted or set to 0, the cookie will expire at the end of the session, i.e. when the browser is closed.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">Here is an example that uses the setcookie () function to create a cookie named username and assign it the value John Carter. It is also specified that the cookie will expire in 30 days (30 days * 24 hours * 60 min * 60 sec).<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n   \/\/ ----------------\n   \/\/ Setting a cookie\n   \/\/ ----------------\n   setcookie(\"username\", \"John Carter\", time()+30*24*60*60);\n?&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">It is important to point out that all the parameters of the setcookie function are optional except the name. In the event that an argument is omitted, it is advisable to replace it with double quotes (&#8220;&#8221;). To omit the expiration of the cookie, set the relative parameter to 0.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">A web developer never stores sensitive data within a cookie, such as the password for access to a portal or other &#8230; so if it is necessary to save sensitive data securely, it is advisable to use sessions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Access_to_cookie_value\"><\/span><strong><strong>Access to cookie value<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">PHP offers a whole series of global variables that the developer can exploit to better manage the functionality that a web app in production requires. One of these variables is the $ _COOKIE global variable in PHP, it is used to retrieve the value of a cookie. It is usually an associative array that contains a list of all cookie values sent by the browser in the current request, encoded by the name of the cookie itself.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">You can access the value of a single cookie using standard array notation, for example, to view the username cookie set in the previous example, you can use the following code.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n   \/\/ ------------------------------------\n   \/\/ Accessing an individual cookie value\n   \/\/ ------------------------------------\n   echo $_COOKIE&#91;\"username\"];\n?&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">The PHP code from the previous example produces the following output:<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><em>John Carter<\/em><\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">It is a good idea to always check if a cookie is set or not before accessing its value. To do this you can use PHP&#8217;s isset () function:<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n   \/\/ ----------------------------------------\n   \/\/ Verifying whether a cookie is set or not\n   \/\/ ----------------------------------------\n   if(isset($_COOKIE&#91;\"username\"])){\n      echo \"Hi\" . $_COOKIE&#91;\"username\"];\n   } else{\n      echo \"Welcome\u2026!\";\n   }\n?&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">You can also use PHP&#8217;s print_r () function like this: print_r ($ _ COOKIE); to see the $_COOKIE associative array structure, just like you do with other types of arrays.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Removal_of_cookie\"><\/span><strong><strong>Removal of cookie<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">You can delete a cookie by always invoking the setcookie () function with the cookie name and any value (such as an empty string, for example), however this time you need to set the expiration date to the past, as shown in the following example:<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n   \/\/ -----------------\n   \/\/ deleting a cookie\n   \/\/ -----------------\n   setcookie(\"username\", \"\", time()-3600);\n?&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\">To make sure that the cookie is deleted correctly, you should go to the setcookie function, exactly the same parameters that you used when you created the cookie.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Cookie in PHP (Hindi)\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/KecYHkyTF-8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><figcaption><a href=\"https:\/\/youtu.be\/KecYHkyTF-8\" target=\"_blank\" rel=\"noreferrer noopener\">Cookie in PHP<\/a><\/figcaption><\/figure>\n\n\n\n<a href=\"https:\/\/www.phpcodewizard.it\/\" alt=\"php code generator\"><\/a>\n","protected":false},"excerpt":{"rendered":"<p>In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.<\/p>\n","protected":false},"author":1,"featured_media":2789,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[268,1059],"tags":[5090,2941,2937,2837,2839,2845],"class_list":["post-2786","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles-en","category-development","tag-ai-en","tag-how-en","tag-how-to-en","tag-new-en","tag-to-en","tag-web-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>what is a cookie in php<\/title>\n<meta name=\"description\" content=\"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"what is a cookie in php\" \/>\n<meta property=\"og:description\" content=\"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Antonio Lamorgese\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-18T16:00:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-20T09:42:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"449\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Antonio Lamorgese\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"what is a cookie in php\" \/>\n<meta name=\"twitter:description\" content=\"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@AntonioLamorge3\" \/>\n<meta name=\"twitter:site\" content=\"@AntonioLamorge3\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"Antonio Lamorgese\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/\"},\"author\":{\"name\":\"Antonio Lamorgese\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\"},\"headline\":\"what is a cookie in php\",\"datePublished\":\"2020-08-18T16:00:56+00:00\",\"dateModified\":\"2022-10-20T09:42:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/\"},\"wordCount\":772,\"publisher\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\"},\"image\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/what-is-a-cookie-in-php.jpg\",\"keywords\":[\"AI\",\"how\",\"how to\",\"new\",\"to\",\"web\"],\"articleSection\":[\"Blog Articles\",\"Development\"],\"inLanguage\":\"it-IT\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/\",\"name\":\"what is a cookie in php\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/what-is-a-cookie-in-php.jpg\",\"datePublished\":\"2020-08-18T16:00:56+00:00\",\"dateModified\":\"2022-10-20T09:42:37+00:00\",\"description\":\"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/what-is-a-cookie-in-php.jpg\",\"contentUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/what-is-a-cookie-in-php.jpg\",\"width\":800,\"height\":449,\"caption\":\"what is a cookie\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/what-is-a-cookie-in-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Development\",\"item\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/en\\\/category\\\/development\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"what is a cookie in php\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#website\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/\",\"name\":\"Antonio Lamorgese\",\"description\":\"Il web e i suoi strumenti operativi\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/#\\\/schema\\\/person\\\/264cf3af38edc93a3362a4c47ec5b2f0\",\"name\":\"Antonio Lamorgese\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\",\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\",\"contentUrl\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\",\"width\":120,\"height\":130,\"caption\":\"Antonio Lamorgese\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/wp-content\\\/uploads\\\/2019\\\/06\\\/ChiSono.png\"},\"description\":\"Amministratore di rete e sviluppatore. Dopo anni di esperienza nel settore, ho ideato un sistema di gestione dati MYSQL in PHP senza scrivere una sola riga di codice.&nbsp;Scopri di pi\u00f9....\",\"sameAs\":[\"https:\\\/\\\/www.Phpcodewizard.it\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/antonio-lamorgese-660735190\\\/\",\"https:\\\/\\\/pinterest.it\\\/antoniolamorgese9711\\\/\",\"https:\\\/\\\/x.com\\\/AntonioLamorge3\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/antoniolamorgese\",\"https:\\\/\\\/tumblr.com\\\/blog\\\/phpcodewizard\"],\"url\":\"https:\\\/\\\/www.phpcodewizard.it\\\/antoniolamorgese\\\/author\\\/antonio-lamorgese\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"what is a cookie in php","description":"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/","og_locale":"it_IT","og_type":"article","og_title":"what is a cookie in php","og_description":"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.","og_url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/","og_site_name":"Antonio Lamorgese","article_published_time":"2020-08-18T16:00:56+00:00","article_modified_time":"2022-10-20T09:42:37+00:00","og_image":[{"width":800,"height":449,"url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg","type":"image\/jpeg"}],"author":"Antonio Lamorgese","twitter_card":"summary_large_image","twitter_title":"what is a cookie in php","twitter_description":"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.","twitter_image":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg","twitter_creator":"@AntonioLamorge3","twitter_site":"@AntonioLamorge3","twitter_misc":{"Scritto da":"Antonio Lamorgese","Tempo di lettura stimato":"5 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#article","isPartOf":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/"},"author":{"name":"Antonio Lamorgese","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0"},"headline":"what is a cookie in php","datePublished":"2020-08-18T16:00:56+00:00","dateModified":"2022-10-20T09:42:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/"},"wordCount":772,"publisher":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0"},"image":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg","keywords":["AI","how","how to","new","to","web"],"articleSection":["Blog Articles","Development"],"inLanguage":"it-IT"},{"@type":"WebPage","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/","name":"what is a cookie in php","isPartOf":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#primaryimage"},"image":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg","datePublished":"2020-08-18T16:00:56+00:00","dateModified":"2022-10-20T09:42:37+00:00","description":"In this article we will see, in detail, what cookies are and how to make the most of them, using one of the most popular languages: PHP.","breadcrumb":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#primaryimage","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg","contentUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2020\/08\/what-is-a-cookie-in-php.jpg","width":800,"height":449,"caption":"what is a cookie"},{"@type":"BreadcrumbList","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/what-is-a-cookie-in-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/"},{"@type":"ListItem","position":2,"name":"Development","item":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/en\/category\/development\/"},{"@type":"ListItem","position":3,"name":"what is a cookie in php"}]},{"@type":"WebSite","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#website","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/","name":"Antonio Lamorgese","description":"Il web e i suoi strumenti operativi","publisher":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":["Person","Organization"],"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/#\/schema\/person\/264cf3af38edc93a3362a4c47ec5b2f0","name":"Antonio Lamorgese","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png","url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png","contentUrl":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png","width":120,"height":130,"caption":"Antonio Lamorgese"},"logo":{"@id":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-content\/uploads\/2019\/06\/ChiSono.png"},"description":"Amministratore di rete e sviluppatore. Dopo anni di esperienza nel settore, ho ideato un sistema di gestione dati MYSQL in PHP senza scrivere una sola riga di codice.&nbsp;Scopri di pi\u00f9....","sameAs":["https:\/\/www.Phpcodewizard.it\/","https:\/\/www.linkedin.com\/in\/antonio-lamorgese-660735190\/","https:\/\/pinterest.it\/antoniolamorgese9711\/","https:\/\/x.com\/AntonioLamorge3","https:\/\/www.youtube.com\/user\/antoniolamorgese","https:\/\/tumblr.com\/blog\/phpcodewizard"],"url":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/author\/antonio-lamorgese\/"}]}},"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/posts\/2786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/comments?post=2786"}],"version-history":[{"count":0,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/posts\/2786\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/media\/2789"}],"wp:attachment":[{"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/media?parent=2786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/categories?post=2786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpcodewizard.it\/antoniolamorgese\/wp-json\/wp\/v2\/tags?post=2786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}