faqts : Computers : Programming : Languages : PHP : Installation and Setup : Sessions & Cookies

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 0 of 1 people (0%) answered Yes

Entry

What do I do with Cannot send cookie - headers already sent by... when I use start_session?

Oct 9th, 2006 10:15
Matthew Wilkinson, Eric Desjardins,


You need to place ob_start() at the beginning of your script so that all
output is saved in a buffer until the script has finished and is then
sent to the browser. If you send output and then send a header, it
breaks the HTTP protocol, and PHP will not allow you to do this.