At 08:54 PM 12/26/2001 -0500, David Jackson wrote:
>I'm trying use the script( and html page) to below to set session
>variables, but
>keep getting the follow errors:
>---------------- Browser Error Messages ---------------------
>Warning: Cannot send session cookie - headers already sent by (output
>started at

Cookies are set and read via HTTP headers, therefore this has to occur 
before any output is sent to the client.  You can work around this with the 
ob_start() and ob_end_flush() functions, but normally you'd want to move 
the session_start() or session_register() calls up to the top of your 
script.  See below:

"Note: If you are using cookie-based sessions, you must call 
session_start() before anything is output to the browser."

"Note: In PHP 4, you can use output buffering to get around this problem, 
with the overhead of all of your output to the browser being buffered in 
the server until you send it. You can do this by calling ob_start() and 
ob_end_flush() in your script, or setting the output_buffering 
configuration directive on in your php.ini or server configuration files."

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to