Web Hosting Talk







View Full Version : cookie problem?


DomiNET.net
08-31-2002, 10:27 AM
Warning: Cannot send session cookie - headers already sent by (output
started at /home/saleitnl/public_html/testlog.php:7) in
/home/saleitnl/public_html/testlog.php on line 8

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/saleitnl/public_html/testlog.php:7) in
/home/saleitnl/public_html/testlog.php on line 8


any hlp?

kunal
08-31-2002, 12:14 PM
Hey,
This is a very common problem.. before you set a cookie or start a session, make sure you dont have any blank spaces or echo statements. Basically, DO NOT send any information to the browser. Even an extra blank space can cause problems.

hope that helps, if not, post your code here so that we can find the exact problem. :)

kunal

aah-jim
08-31-2002, 03:01 PM
i encountered this problem a lot, until I came across this magic line,
ob_start();
just put that at the start of your code and it will buffer the data preventing any errors, its never failed with me :)

dreamrae.com
09-02-2002, 08:38 AM
um...no...you MUST make sure your cookie goes before ANYTHING ELSE, even when sending such headers as "location: blah" or "http 1.1" etc... the cookies must come 1st.. php.net :D