Page 1 of 1

setcookie session_start and head()

Posted: Wed Jan 28, 2009 3:50 pm
by iwsyang
people said setcookie MUST be the first line before any output,
people said sessin_start() MUST be the first line before any output,
people also said head() MUST be the first line before any output,.

If I need to use thes three function in one document, what is the order of these three lines?

Re: setcookie session_start and head()

Posted: Wed Jan 28, 2009 4:02 pm
by requinix
They don't have to be the absolute first thing, they just have to be before you start outputting anything. As for what order you should use them it doesn't matter.

If output begins on line 100 then those three can be anywhere on lines 1 through 99.