Welcome Guest, Not a member yet? Register   Sign In
Message: Cannot modify header information - headers already sent by (output started at etc. Filename: libraries/Session.
#1

[eluser]Unknown[/eluser]
CodeIgniter error: Message: Cannot modify header information - headers already sent by (output started at etc. Filename: libraries/Session.php SOLVED

Solution: Autoload the Session.php

Isolating the error that caused the error look at the code below:
These lines:
Code:
$this->load->library('table');   exit();
$this->load->library('session');

did not produce an error.

====================================
These lines

Code:
$this->load->library('table');
$this->load->library('session');exit();

or

Code:
$this->load->library('table');$this->load->library('session');exit();
result in the following error:

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/bmak.ca/cssmenu.php:20)

Filename: libraries/Session.php

Line Number: 672


The solution: was to autoload session ref: http://ellislab.com/codeigniter/user-gui...oader.html

made the change:
Code:
$autoload['libraries'] = array('session');
note: you don't need to have an array - I will likely autoload other classes.

The above ERROR no longer occurred.




Theme © iAndrew 2016 - Forum software by © MyBB