On Thu, 21 Jul 2005 11:43:55 -0700, lkrubner wrote: No, I meant, I was setting a cookie, then calling session_start(), and
I was getting an error. Can I call session_start() and then set a
cookie? I want to set a permanent cookie that will last one million
seconds. I also want sessions.
AND WHAT IS THE ERROR????
This is the error I'm getting:
<b>Warning</b>: session_start(): Cannot send session cookie - headers
already sent in
<b>/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/pdsIncludes/CommandStartSession.php</b>
on line <b>14</b><br />
<br />
<b>Warning</b>: session_start(): Cannot send session cache limiter -
headers already sent in
<b>/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/pdsIncludes/CommandStartSession.php</b>
on line <b>14</b><br />
This is line 14 and 15 of CommandStartSession:
session_start();
session_register();
I used my text editor (RedCrimson) and did a search of all the files in
this project, looking for session_start(). I thought maybe, by
accident, I was calling it twice. But no, it only appears once.
Oddly, when I call session_start(), output buffering is on, so I'm not
sure how I get that error. Later I set a cookie, then I sent a charset
header indicating that the characters are UTF-8, then I end output
buffering.
I thought the output buffering would keep me safe from this kind of
error, but apparently not.