Shelley Shyan schreef:
Hi all,
Maybe this is a somehow stupid question.
I want to know how php could know whether session_start() has been called, that
is, whether session has been started.
you can do it by checking the return value of session_id() if it's empty you
can be pretty
sure session_start() was not called. having said that I think your better off
writing code that can assume the session was started (e.g. by including a
file that init's the session [and whatever else is relevant) ... but that may
not be doable.
see here: http://php.net/session_id
I don't recommend the auto_session_start ini setting because there are probably
times when you explicitly don't need/want the session started.
I Googled, but got little help.
Thank you for help!
Any tip is greatly appreciated.
Regards,
Shelley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php