Re: Using and Echoing Session Variables
| From: | Jason Barnett | 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:Scratch that... you can modify session keys after you've started sending output. Jeez, I need to get to sleep :)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.
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.