By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,606 Members | 3,802 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,606 IT Pros & Developers. It's quick & easy.

Warning: session_start() [function.session-start]: Cannot send session cache limiter

P: 2
Hi everybody,

I have this problem.-
The browser launch this two errors:
Expand|Select|Wrap|Line Numbers
  1. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/notasluz/public_html/administrador/Administrador.php:1) in /home/notasluz/public_html/administrador/verificaEntrada.php on line 2
  2. 
  3. Warning: Cannot modify header information - headers already sent by (output started at /home/notasluz/public_html/administrador/Administrador.php:1) in /home/notasluz/public_html/administrador/verificaEntrada.php on line 10
  4.  
The code of verificaEntrada is:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. if(strlen($_POST[Xlogin])>4 && strlen($_POST[Xpass])==32){
  4.     $manejadorUsuerio = new ManejadorUsuario();
  5.     if($manejadorUsuerio->existeUsuario($_POST[Xlogin],$_POST[Xpass])){
  6.         $usuario=$manejadorUsuerio->getUsuario();
  7.         $_SESSION['nombre']=$usuario->getNombre() . ' ' . $usuario->getApellido();
  8.         $_SESSION['usuario']=$usuario;
  9.         $_SESSION['time']=time();
  10.         header("Location: index.php");
  11.     }else{
  12.         header("Location: login.php?error=unregister");
  13.     }
  14. }else{
  15.     echo "Error en parametros";
  16. }
  17.  
  18. function __autoload($class_name) {require_once $class_name . '.php';}
  19.  ?>
and the code of Administrador is:

Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. class Administrador{
  3.     private $id;
  4.     private $login;
  5.     private $password;
  6.     private $nombre;
  7.     private $apellido;
  8.     private $nickname;
  9.     private $email;
  10.     private $telefono1;
  11.     private $telefono2;
  12.  
  13.     public function __construct($id,$login,$password,$nombre,$apellido,$nickname,$email,$telefono1,$telefono2)
  14.     {
  15.         $this->id = $id;
  16.         $this->login = $login;
  17.         $this->password = $password;
  18.         $this->nombre = $nombre;
  19.         $this->apellido = $apellido;
  20.         $this->nickname = $nickname;
  21.         $this->email = $email;
  22.         $this->telefono1 = $telefono1;
  23.         $this->telefono2 = $telefono2;
  24.     }
  25.  
  26.     public function getId(){return $this->id;}
  27.     public function getLogin(){return $this->login;}
  28.     public function getPassword(){return $this->password;}
  29.     public function getNombre(){return $this->nombre;}
  30.     public function getApellido(){return $this->apellido;}
  31.     public function getNickname(){return $this->nickname;}
  32.     public function getEmail(){return $this->email;}
  33.     public function getTelefono1(){return $this->telefono1;}
  34.     public function getTelefono2(){return $this->telefono2;}
  35.  
  36.     public function setId($id){$this->id=$id;}
  37.     public function setLogin($login){$this->login=$login;}
  38.     public function setPassword($password){$this->password=$password;}
  39.     public function setNombre($nombre){$this->nombre=$nombre;}
  40.     public function setApellido($apellido){$this->apellido=$apellido;}
  41.     public function setNickname($nickname){$this->nickname=$nickname;}
  42.     public function setEmail($email){$this->email=$email;}
  43.     public function setTelefono1($telefono1){$this->telefono1=$telefono1;}
  44.     public function setTelefono2($telefono2){$this->telefono2=$telefono2;}
  45. }
  46.  ?>
Somebody help me please!

Thanks!
Sep 29 '07 #1
Share this Question
Share on Google+
3 Replies


pbmods
Expert 5K+
P: 5,821
Heya, Mrosado. Welcome to TSDN!

You are getting this warning because your script outputs something before you call session_start().

Double check all your files for whitespace before the opening '<?php' tag.
Sep 30 '07 #2

P: 2
Thank you.-

But the problem was the codification of the file. I'm having problems with UTF-8 and the BOM. I saw in other forum that this codificatión send 3 invisible caracters at start and it's somithing like header, so that 's why the browser lounch the error.

Thanks again! I hope this could help other people with similar errors!
Sep 30 '07 #3

pbmods
Expert 5K+
P: 5,821
Heya, Mrosado.

Thanks for posting your solution.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Sep 30 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.