Re: [PHP] Multiple session_start()s / Is it a problem??

2004-11-10 Thread Klaus Reimer
Al wrote:
Is there a problem issuing multiple session_start()s for a given script?
I can't find anything in the manual that says one way or the other.
Then you have not looked good enough ;-)

I have some scripts that call more than one functions include file and 
for convenience put a session_start() on each one.
This gives me a "Notice" error.
You'll find this in the documentation of session_start(): "Note:  As of 
PHP 4.3.3, calling session_start() while the session has already been 
started will result in an error of level E_NOTICE. Also, the second 
session start will simply be ignored."

So there is no problem with multiple calls to session_start(). You can 
safely ignore the notice.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Multiple session_start()s / Is it a problem??

2004-11-10 Thread Al
Is there a problem issuing multiple session_start()s for a given script?
I can't find anything in the manual that says one way or the other.
I have some scripts that call more than one functions include file and for 
convenience put a session_start() on each one.

This gives me a "Notice" error.
Of course I can simply use "@session_start()" to negate the Notice; but, I want 
to be certain this is good practice.

Al.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Multiple session_start()s / Is it a problem??

2004-11-10 Thread Greg Donald
On Wed, 10 Nov 2004 10:40:17 -0500, Al <[EMAIL PROTECTED]> wrote:
> Of course I can simply use "@session_start()" to negate the Notice; but, I 
> want
> to be certain this is good practice.

I haven't tried it but you might try wrapping session_start() that
with if ( !isset ($_SESSION) ) if you don't like using the @ error
suppression.  I usually have a single common file like config.php or
something that I do session_start() in, so I've never actually ran
across this issue.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php