Welcome Guest, Not a member yet? Register   Sign In
What happens with sessions??
#7

[eluser]IEDani[/eluser]
Hi,
I am searching the error but I don´t find it...

----------------
This is the error:
A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/x.com/httpsdocs/CodeIgniter/system/application/models/acceso_model.php:23)

Filename: libraries/Session.php

Line Number: 662

----------------
This is the code of acceso_model.php, the document that sent the headers (¿?):

<?php
class Acceso_Model extends Model {

function Acceso_Model(){
// Call the Model constructor
parent::Model();
}

function esValido($usuario,$contrasenia){
//compruebo que el usuario existe
$sql='SELECT * FROM Usuarios WHERE usuario=?';
$query = $this->db->query($sql,array($usuario));
$acceso=($query->num_rows() > 0);
//si el usuario existe compruebo que su clave es correcta
if ($acceso){
$row = $query->row();
$acceso= $row->contrasenia == md5($contrasenia);
}
return $acceso;
}
}
?>


----------------
This is a piece of the code of acceso.php, that fix the session and call to acceso_model.php
.......
$this->load->model("Acceso_Model");
if ($this->Acceso_Model->esValido($usuario,$contrasenia)){
$this->load->library('session');
$datosAcceso = array(
'usuario' => $usuario,
'logado' => TRUE
);
$this->session->set_userdata($datosAcceso);
............
--------------------------
I am sure that we can solve it!
Thaks you so much!
Dani


Messages In This Thread
What happens with sessions?? - by El Forum - 04-22-2009, 06:05 AM
What happens with sessions?? - by El Forum - 04-22-2009, 06:17 AM
What happens with sessions?? - by El Forum - 04-22-2009, 07:46 AM
What happens with sessions?? - by El Forum - 04-23-2009, 03:23 AM
What happens with sessions?? - by El Forum - 04-23-2009, 03:33 AM
What happens with sessions?? - by El Forum - 04-23-2009, 03:38 AM
What happens with sessions?? - by El Forum - 04-23-2009, 05:52 AM
What happens with sessions?? - by El Forum - 04-23-2009, 05:57 AM
What happens with sessions?? - by El Forum - 04-23-2009, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB