View Single Post

  #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