httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Goldstein <white...@whitewlf.net>
Subject Re: [users@httpd] Cannot send session cookie
Date Thu, 12 Feb 2004 18:24:34 GMT
Even oddball characters like linefeeds and such sent before the </head> 
tag will cause this.  Some WYSIWYG tools drop erroneous stuff up there 
by accident. It makes the server think it is html.  Also, you can get 
around this, if necessary, by changing the directives in the php.ini 
file to buffer/parse the page in full before sending... though, that is 
really a kludge.

-- 
Adam Goldstein
White Wolf Networks
http://whitewlf.net


On Feb 12, 2004, at 4:40 AM, Jez Hancock wrote:

> On Thu, Feb 12, 2004 at 09:58:39AM +0100, michele digioia wrote:
>> Hi, I'm a new user. I have this problem: when a session_start() php
>> request is sended to the apache server that I admin (by few days), it
>> responses with following messages:
>>
>> Warning: Cannot send session cookie - headers already sent by (output
>> started at .../Admin/Dbconnector.inc:120) in .../Admin/login.php on
>> line 4
>>
>> Warning: Cannot send session cache limiter - headers already sent
>> (output started at .../Admin/Dbconnector.inc:120) in
>> .../Admin/login.php on line 4
>>
>> Is this a problem of php or apache? And how can I solve it? Thanks.
>
> This is a PHP problem and so OT here.
>
> As a hint - make sure your script hasn't already sent out any HTML to
> the browser before it's trying to set a session variable.
>
> The error occurs because PHP can only send session data in the HTTP
> headers sent out from the web server - if you've already sent out some
> HTML / output to the browser this means the HTTP headers have already
> been sent and so if you try sending session data at that point the 
> error
> you get occurs.
>
> -- 
> Jez Hancock
>  - System Administrator / PHP Developer
>
> http://munk.nu/
> http://jez.hancock-family.com/  - Another FreeBSD Diary
> http://ipfwstats.sf.net/        - ipfw peruser traffic logging
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message