note 130409 added to function.setcookie

From: Date: Mon, 07 Jul 2025 13:43:27 +0000
Subject: note 130409 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-222263@lists.php.net to get a copy of this message
Please keep in mind that if you call setcookie() several times during the script execution (even for the same name, domain and path), then Set-Cookie header will be sent several times, and only after receiving all of them, client browser will "merge" them, replacing first value for the cookie with the next etc. This may cause very large headers length sometimes, so you'll have to either increase buffers for your web server; change your code logic to determine all possibly-changing parameters values right from the start; implement some sort of global Response object keeping all the data, including cookies as well, till the end of processing (sort of optimized output beffering); or just avoid storing any large data in cookies. ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 109.245.95.123) ---- Manual Page -- https://php.net/manual/en/function.setcookie.php Edit -- https://main.php.net/note/edit/130409 Del: integrated -- https://main.php.net/note/delete/130409/integrated Del: useless -- https://main.php.net/note/delete/130409/useless Del: bad code -- https://main.php.net/note/delete/130409/bad+code Del: spam -- https://main.php.net/note/delete/130409/spam Del: non-english -- https://main.php.net/note/delete/130409/non-english Del: in docs -- https://main.php.net/note/delete/130409/in+docs Del: other reasons-- https://main.php.net/note/delete/130409 Reject -- https://main.php.net/note/reject/130409 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222263) next »