Estoy haciendo una web he creado una clase login si se valida bien guardo la clase en la session con los datos correctos, luego al recuperar los datos me tira un error, el error es este:
CitarFatal error: main() [<a href='function.main'>function.main</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Login" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in C:\Documents and Settings\Administrador\Mis documentos\wwwroot\web\Index.php on line 33
y la linea 33 es:
if(isset($_SESSION['login'])){
$logins=$_SESSION['login'];
echo $logins->getId();(linea 33)
}
y la función getId es:
public function getId(){
return $this->id;
}
gracias por la ayuda ::)
Usualmente sucede al manejar objetos y tratar de mantenerlos en la sesion , prueba incluyendo las clases antes de llamar al session_start().
include("miclase.inc.php");
session_start();
Saludos¡¡
Citarof the object you are trying to operate on was loaded _before_ unserialize()
Iniciaste la Clase?
new Class.. etc?