Re: ob_start & session_start

From: Date: Thu, 08 Dec 2005 06:55:02 +0000
Subject: Re: ob_start & session_start
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-227111@lists.php.net to get a copy of this message
On Thu, Dec 08, 2005 at 01:23:40AM -0500, Joe Harman wrote: > > So, the question is really... in what order is the best way to do > this... I would think that you always want to start a session first... > but then again, you guys are the experts... i am sure someone knows a > reason when you should not do that. The first thing I would ask is why are you using/need ob_start(). session_start() should be the first thing that happens in most cases. Since, well, any code that exist is potentially going to rely on a session state. If you are trying to use ob_start() to rid of the common error 'headers already sent in some_file.php on line such and such', i would first consider why that is causing the error and how can you call session_start() before that happens. Since '97 i think i've used ob_start twice, in all my php apps, and that was cause I wanted to filter the output either with tidy or modify the data in a very obscure way. Curt. -- cat .signature: No such file or directory

« previous php.general (#227111) next »