470,855 Members | 1,187 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

Session_start()

I get this error message: A session had already been started - ignoring
session_start().

How can I check to see if a session was started already?

Thanks
Jan 16 '06 #1
4 19224
On Mon, 16 Jan 2006 17:43:46 -0500, camou <camou@camou> wrote:
I get this error message: A session had already been started - ignoring
session_start().

How can I check to see if a session was started already?


Probably http://uk2.php.net/session_id

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 17 '06 #2
camou wrote:
I get this error message: A session had already been started - ignoring
session_start().

How can I check to see if a session was started already?

if (!session_id()) {
/* session not started */
}

--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Jan 17 '06 #3
On Tue, 17 Jan 2006 00:17:03 +0000, Pedro Graca wrote:
camou wrote:
I get this error message: A session had already been started - ignoring
session_start().

How can I check to see if a session was started already?

if (!session_id()) {
/* session not started */
}

I thought it was

if (session_id() == "")
{
/* session not started */
}

Steve
Jan 17 '06 #4
On 2006-01-17, Steve <Th*****@Aint.Valid> wrote:
On Tue, 17 Jan 2006 00:17:03 +0000, Pedro Graca wrote:
camou wrote:
I get this error message: A session had already been started - ignoring
session_start().

How can I check to see if a session was started already?

if (!session_id()) {
/* session not started */
}

I thought it was

if (session_id() == "")
{
/* session not started */
}


There are some usercomments about that in the manual on
http://www.php.net/session_id

I prefer to do it as following:

if (!isset($_SESSION)) {
// session is not started.
}

As documented on http://www.php.net/session the global $_SESSION only becomes
available after the use of session_start();

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
Jan 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Florence HENRY | last post: by
19 posts views Thread by Chris Allen | last post: by
2 posts views Thread by Reply-Via-Newsgroup Thanks | last post: by
1 post views Thread by Mercy | last post: by
5 posts views Thread by Niklas Uhlin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.