session_start error help

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


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-22-2005
Bruintje Beer
 
Posts: n/a
Default session_start error help

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





Reply With Quote
  #2 (permalink)  
Old 11-22-2005
vdP
 
Posts: n/a
Default Re: session_start error help

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
Reply With Quote
  #3 (permalink)  
Old 11-22-2005
Bruintje Beer
 
Posts: n/a
Default Re: session_start error help


"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


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:58 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0