danmontgomery/codeigniter-session-driver — Issue #4: headers already sent
Author: mspace
Created: 2012-01-23 15:40:49+00:00
State: open

Using:

linux,
php 5.3.8
mysql 5.5.16
Codeigniter 2.1.0

$config['sess_driver']	= 'database';
$config['sess_cache_driver']	= '';

public function test()
{
$this->session->set_userdata('name', 'TEST');

echo $this->session->userdata('name');
}

Output:

TEST
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /srv/web/test/application/controllers/front.php:54)

Filename: session/Session_database.php

Line Number: 366

I also repaired this: system/core/Exception.php

//include(APPPATH.'errors/error_php.php');
include($_SERVER['DOCUMENT_ROOT']. '/' . APPPATH.'errors/error_php'.EXT);

I think the problem is that, you write $this->sess_write in __destruct().