Welcome Guest, Not a member yet? Register   Sign In
Session Library creating headers problem
#1

[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
#2

[eluser]aroman[/eluser]
Hi FuRy,

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

cheers
- aroman




Theme © iAndrew 2016 - Forum software by © MyBB