[Notice] A session had already been started – ignoring session_start()


How to resolve this prado framwork error message ?

[Notice] A session had already been started – ignoring session_start() (@line 134 in file /opt/lampp/htdocs/your_app/prado/framework/Web/THttpSession.php).

You can fix with. Firstly you can open existing “THttpSession.php” file and check line 134 (in my case).

As you can see, red script causing that error above. So you can remove and replace with green script.

<?

public function open()
{
if(!$this->_started)
{
if($this->_customStorage)
session_set_save_handler(array($this,’_open’),array($this,’_close’),array($this,’_read’),array($this,’_write’),array($this,’_destroy’),array($this,’_gc’));
if($this->_cookie!==null)
session_set_cookie_params($this->_cookie->getExpire(),$this->_cookie->getPath(),$this->_cookie->getDomain(),$this->_cookie->getSecure());
            if(ini_get(‘session.auto_start’)!==’1′)
                session_start();

            if(headers_sent()){ session_start(); }

// if(!isset($SESSION)) { ob_start(); session_start();}
$this->_started=true;
}
}

?>

Hope this helpfully.

Blackphp

About blackphp

All about programming php, ajax, jquery, mysql, etc, tips n trick. Now, i'm concern in php programming with codeigniter framework n also training my design skill with photoshop or corel... wish me luck! ('o')

Posted on October 24, 2013, in PHP, Prado Framework and tagged , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: