CodeIgniter Forums
Session Library creating headers problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Session Library creating headers problem (/showthread.php?tid=11509)



Session Library creating headers problem - El Forum - 09-11-2008

[eluser]Unknown[/eluser]
This is a function i've written

function login_user()
{
$this->User->email = $this->input->post('email');
$this->User->password = $this->input->post('password');

$result = $this->User->getUser();

if($result)
{

$this->session->set_userdata('id',$result[0]->id);
$this->session->set_userdata('type',$result[0]->type);
$this->load->view('/user/home');

}

}
The following two lines cause the following error I do not understand now. If i remove these lines the error goes away. (Theres no blank space or anything before the <?php tags)

$this->session->set_userdata('id',$result[0]->id);
$this->session->set_userdata('type',$result[0]->type);

The error i get is

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\rrs\system\application\models\user.php:90)

Filename: libraries/Session.php

Line Number: 315

Kindly help me out as i am really stuck here


Session Library creating headers problem - El Forum - 09-15-2008

[eluser]aroman[/eluser]
Hi FuRy,

Try to read this thread -> http://ellislab.com/forums/viewthread/90917/
hope it helps to you..

cheers
- aroman