Re: PHP session variables
| From: | Tedd Sperling | Date: | Wed, 15 Aug 2012 19:24:30 +0000 |
| Subject: | Re: PHP session variables | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318713@lists.php.net to get a copy of this message | ||
Andrew:
Your points are well taken -- thanks.
However, my only concern is given this:
> for($i=1; $i < 1000; $i++)
> {
> if (!defined('SID'))
> {
> echo __LINE__, '::session_start()<br>';
> session_start();
> }
> }
The php manual ( http://us3.php.net/manual/en/function.session-start.php
)
First Note states that session_start() must be called *before* anything sent to the Browser.
So, to rewrite your code --
for($i=1; $i < 1000; $i++)
{
if (!defined('SID'))
{
session_start();
echo __LINE__, '::session_start()<br>';
}
}
-- should work better, right?
Cheers,
tedd
_____________________
tedd@sperling.com
http://sperling.com