Re: Using and Echoing Session Variables

From: Date: Sun, 18 Jul 2004 11:23:40 +0000
Subject: Re: Using and Echoing Session Variables
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-190907@lists.php.net to get a copy of this message
Jason Barnett wrote:
Harlequin wrote:
Jason Would there be anything wrong with using an include statement at the top of every page and the include page could then start a session, execute queries etc or would the session not start as it's not the first line in the page...?
That's completely fine. The main thing is, you just want to have session keys get written before you start sending output.
Scratch that... you can modify session keys after you've started sending output. Jeez, I need to get to sleep :)
Just to throw out another idea... Do you plan on having session keys used for *every* page? If so, then you could set your php.ini auto_prepend_file to automatically process your session script for every request. The main downside is if you have pages that don't really need the session vaiables then you'll be wasting resources when serving those pages.


« previous php.general (#190907) next »