Re: Re: Multiple session_start()s / Is it a problem??
| From: | Curt Zirzow | Date: | Sat, 13 Nov 2004 06:20:27 +0000 |
| Subject: | Re: Re: Multiple session_start()s / Is it a problem?? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201893@lists.php.net to get a copy of this message | ||
* Thus wrote elixon:
> I guess that session_id() method will return null if session is not
> started (not tested) so theoreticaly you can use:
>
> if (!session_id()) session_start();
This is the best method. relying that $_SESSION is set could
falsify your reliance that the session has been started. For
example, some code may be trying to clear all session data prior to
this with:
$_SESSION = array();
Even though it is really set it doesn't mean that the session has
truely started.
Curt
--
Quoth the Raven, "Nevermore."