Re: A stupid question?
| From: | Eric Butera | Date: | Fri, 18 Jan 2008 13:18:35 +0000 |
| Subject: | Re: A stupid question? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267540@lists.php.net to get a copy of this message | ||
On Jan 17, 2008 9:54 PM, Shelley Shyan <Shelley.Shyan@morodo.com.cn> wrote:
> 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.
>
> I Googled, but got little help.
>
> Thank you for help!
> Any tip is greatly appreciated.
>
> Regards,
> Shelley
>
>
One other thing is you won't be able to start a session if headers
have been sent. It is a good idea to use output buffering to help aid
with this. If headers have been sent you'll get a nasty warning.
It can be a php.ini setting or you can simply call ob_start() on the
first line of your script.