note 129070 added to function.setcookie

From: Date: Sun, 26 Nov 2023 20:27:47 +0000
Subject: note 129070 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-221024@lists.php.net to get a copy of this message
localhost Clarification (tested on Firefox/php 8.2.7) Unlike a previous note on this page, which no longer seems to be correct, PHP not only accepts localhost as the domain, it seems to require it. <?php setcookie('cookiename', 'cookievalue', time() + , '/', 'localhost'); // WORK setcookie('cookiename', 'cookievalue', time() + , '/', false||null||""); // NOT WORK ?> ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.134 (proxied: 157.52.30.161) ---- Manual Page -- https://php.net/manual/en/function.setcookie.php Edit -- https://main.php.net/note/edit/129070 Del: integrated -- https://main.php.net/note/delete/129070/integrated Del: useless -- https://main.php.net/note/delete/129070/useless Del: bad code -- https://main.php.net/note/delete/129070/bad+code Del: spam -- https://main.php.net/note/delete/129070/spam Del: non-english -- https://main.php.net/note/delete/129070/non-english Del: in docs -- https://main.php.net/note/delete/129070/in+docs Del: other reasons-- https://main.php.net/note/delete/129070 Reject -- https://main.php.net/note/reject/129070 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221024) next »