[PHP] Saving cookies
[email protected] Sun, 12 Apr 2026 12:49:02 +1200
| Newsgroups | php.general |
|---|---|
| Message-ID | <CACOt7mH6jU9iD8g2ENJkWzbC=0=y4S6wY9tQ+XtTBVeg6X=t3A@mail.gmail.com> |
hi, I've spent HOURS on this & its driving me nuts...
i understand that if you set a cookie & it fails, it fails silently..
(no errors)
Is there a way to force an error if it fails ? - Fog horn, Siren
blast, a cannon - "here is an error"
Basically, If i set a cookie in a 3-4 line test script, the cookie is
set, no problems..
but do it in my main script, and it fails every time... One culprit is
that headers already sent will not allow cookies to be sent.
Ive got this at the top of my included script, as well as IMMEDIATELy
before the cookie is set
if (headers_sent($file, $line)) {
echo "<pre>HEADERS ALREADY SENT at $file:$line</pre>";
exit;
}
However no errors located...
Is there a guaranteed way that i can find the reason for cookies to
fail being set ?
--
Gordon.