Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/01/2012, 17:44
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 2 meses
Puntos: 20
Problemas con modify header, función logout

Buenas,

No entiendo porque me da los siguientes errores:

Warning: Cannot modify header information - headers already sent by (output started at /home/web/public_html/layouts/layout_none.php:2) in /home/web/public_html/libs/clases/login.class.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/web/public_html/layouts/layout_none.php:2) in /home/web/public_html/libs/clases/login.class.php on line 163

Warning: Cannot modify header information - headers already sent by (output started at /home/web/public_html/layouts/layout_none.php:2) in /home/web/public_html/libs/clases/login.class.php on line 170

La función que que está en esas lineas es esta

Código PHP:
Ver original
  1. public function logout($user_id){
  2.         $_SESSION = array();  // vacio la sesion
  3.         // la destruyo
  4.         setcookie("recuerdame","",time()-3600,"/","www.web.com");
  5.         setcookie("sesionSafe","",time()-3600,"/","www.web.com");
  6.         session_destroy();
  7.         header ("Location: /");
  8.         exit;                              
  9.     }

Es la típica función de eliminar las cookies y sesiones, pero el servidor linux.

¿Estoy haciendo algo mal sin darme cuenta?

Muchas gracias de antemano!