Forum Moderators: coopster

Message Too Old, No Replies

Warning: session_start

Warning: session_start error

         

caveman28

5:57 am on Oct 25, 2003 (gmt 0)

10+ Year Member


I have a shopping cart script and when I hit add to cart, I get these errors... any ideas why?

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/includes/config.inc:10) in /var/www/html/cart.php on line 7

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/includes/config.inc:10) in /var/www/html/cart.php on line 7

jpjones

7:14 am on Oct 25, 2003 (gmt 0)

10+ Year Member



headers already sent by (output started at /var/www/html/includes/config.inc:10)

The above gives the game away.

When you call Session_start(), PHP tries to set a cookie on the browser through the headers, so it can identify that session with that browser.

However, your config.inc file outputs something at line 10 (have you got extra whitespace/carriage returns after closing the PHP code?), which means that PHP cannot add anything more to the headers. Hence why you have the error messages.

Solution - stop the output in line 10 of config.inc!

HTH,
JP