Notice: A session had already been started...

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
JWalker
Regular
Posts: 177
Joined: Mon Sep 12, 2005 4:14 pm
Location: Botevgrad, Bulgaria
Contact:

Notice: A session had already been started...

Post by JWalker »

After upgrading to the latest version - 1.2, at very first loading of the blog this message appears at the bottom of the page:

Code: Select all

Notice: A session had already been started - ignoring session_start() in D:\biz\apps\serendipity\serendipity_config.inc.php on line 20
My system is
Windows XP SP2 / Apache 2.0.59 / PHP 5.2.3 / Firefox 2.0.0.6.
From serendipity_config.inc.php:

Code: Select all

if (!headers_sent()) {
    session_start();
    
    // Prevent session fixation by only allowing sessions that have been sent by the server.
    // Any session that does not contain our unique token will be regarded as foreign/fixated
    // and be regenerated with a system-generated SID.
    // Patch by David Vieira-Kurz of majorsecurity.de
    if (!isset($_SESSION['SERVER_GENERATED_SID'])) {
        session_regenerate_id(true);
        session_start();                 // <<<<<<<<<<<<<<<<<<< line 20
        header('X-Session-Reinit: true');
        $_SESSION['SERVER_GENERATED_SID'] = true;
    }
}
Thereafter it does not appear.
Ivan Cenov
OKTO-7 Co., Botevgrad
Bulgaria
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Notice: A session had already been started...

Post by garvinhicking »

Hi!

Try to put a "@" in front of that session_start? It seems to only be a PHP notice, and thus can be suppressed.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JWalker
Regular
Posts: 177
Joined: Mon Sep 12, 2005 4:14 pm
Location: Botevgrad, Bulgaria
Contact:

Yes

Post by JWalker »

Hi,

I've put '@' and the message did not appear anymore.
Thanks!
Ivan Cenov
OKTO-7 Co., Botevgrad
Bulgaria
Post Reply