01-20-2008, 10:22 PM
[eluser]alebenson[/eluser]
hi there!
i was doing something with sessions and i got this error
Message: Cannot modify header information - headers already sent by...
i look it up in the forum and everyone said that is the space before ?> or an echo... so i made test to discard those things
1_first
result OK! OK! OK!
2_second
result OK! OK! OK!
same results
well i dont get the error... but i dont understand why i get the same result after a kill the session
hi there!
i was doing something with sessions and i got this error
Message: Cannot modify header information - headers already sent by...
i look it up in the forum and everyone said that is the space before ?> or an echo... so i made test to discard those things
1_first
Code:
class Test extends Controller {
function index()
{
$this->load->library('session');
$check = $this->session->userdata('session_id');
if ($check == FALSE)
{
echo 'FALSE FALSE FALSE';
}
else
{
echo 'OK! OK! OK!';
}
}
}
result OK! OK! OK!
2_second
Code:
class Test extends Controller {
function index()
{
$this->load->library('session');
$this->session->sess_destroy(); //// NEW LINE HERE
$check = $this->session->userdata('session_id');
if ($check == FALSE)
{
echo 'FALSE FALSE FALSE';
}
else
{
echo 'OK! OK! OK!';
}
}
}
result OK! OK! OK!
same results
well i dont get the error... but i dont understand why i get the same result after a kill the session