Re: can I still send cookies after I've called session_start()




>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.

.



Relevant Pages

  • RE: Authentication Ticket Persistance
    ... code running on login.xyz.net actually writes the authentication cookie, ... then checks the domain of the ReturnURL from the calling application ... Upon receiving your response, I decided to research the issue further. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Best Chocolate Chip Cookie - Ever
    ... not the cure for cancer. ... No name calling or no one get's to eat a cookie. ...
    (rec.food.cooking)
  • Cookie problem
    ... I have client-side javascript that create a cookie by calling ... after reading that cookie value I would like to reset ...
    (microsoft.public.dotnet.framework.aspnet)
  • Cookie array does not work ?
    ... // Get most recent cookie ... I appreciate that I shouldn't be calling my page variables by ... the same name as my cookie variables but that is not the problem - it ... Prev by Date: ...
    (comp.lang.php)
  • Re: using LWP to POST data via "javascript:document.form.submit()" link
    ... But what about these randomly generated cookie values?? ... eKIQUeS7L3meAjS...etc) how am i supposed to reverse engineer that?? ... feed the information to a Perl routine that you hand-translated from Javascript. ... Possibly you can get away with just calling HTTP::Cookies to create them. ...
    (comp.lang.perl.misc)

Loading