This is a discussion on session_start error help within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, I have the following error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I have the following error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/httpd/vhosts/demo/httpdocs/beveiligd.php:7) in /home/httpd/vhosts/demo/httpdocs/inc_logged_in.php on line 1 What am i doing wrong John |
|
|||
|
Bruintje Beer wrote:
> Hi, > > I have the following error: > > Warning: session_start() [function.session-start]: Cannot send session > cookie - headers already sent by (output started at > /home/httpd/vhosts/demo/httpdocs/beveiligd.php:7) in > /home/httpd/vhosts/demo/httpdocs/inc_logged_in.php on line 1 > > What am i doing wrong > > John Hi Bruintje, If you want to propagate the session-ID by cookies, you must call session_start before you have outputted anything. Make sure that there are no echo or print statements before you call session_start (also consider the files you include). Also make sure that there is nothing (and I mean absolutely nothing, not even whitespace) before the start of your PHP-script, i.e. the <?php tag. I hope this helps. vdP |
|
|||
|
"vdP" <hvdploeg_NO_SPAM@wanadoo.nl> schreef in bericht news:43837b15$0$88568$dbd4d001@news.wanadoo.nl... > Bruintje Beer wrote: >> Hi, >> >> I have the following error: >> >> Warning: session_start() [function.session-start]: Cannot send session >> cookie - headers already sent by (output started at >> /home/httpd/vhosts/demo/httpdocs/beveiligd.php:7) in >> /home/httpd/vhosts/demo/httpdocs/inc_logged_in.php on line 1 >> >> What am i doing wrong >> >> John > > Hi Bruintje, > > If you want to propagate the session-ID by cookies, you must call > session_start before you have outputted anything. Make sure that there are > no echo or print statements before you call session_start (also consider > the files you include). Also make sure that there is nothing (and I mean > absolutely nothing, not even whitespace) before the start of your > PHP-script, i.e. the <?php tag. > > I hope this helps. > > vdP Hi, thank you very much, i did some printing before and removed it, now it is working ok. regards John |
![]() |
| Thread Tools | |
| Display Modes | |
|
|