473,769 Members | 7,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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
3 2847
pbmods
5,821 Recognized Expert Expert
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
mrosado
2 New Member
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
5,821 Recognized Expert Expert
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

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

Similar topics

2
3210
by: Paul | last post by:
Dear experts, I have a problem with session_start() and JavaScript. In IE6 (but not Mozilla) the first time the page below loads the JavaScript doesn't work (clicking on the graphic should write 'click' in the form entry box). After you hit refresh it works fine. IE doesn't report any error (reporting is turned on). It also works fine if I remove the "session_start()". Is this an IE bug or am I doing something wrong? Is there a fix or...
29
2526
by: junky_fellow | last post by:
Consider the following piece of code: struct junk { int i_val; int i_val1; char c_val; }; int main(void) {
3
2727
by: Bas Wassink | last post by:
Hello there, I'm having trouble understanding a warning produced by 'splint', a code-checker. The warning produced is: keywords.c: (in function keyw_get_string) keywords.c:60:31: Released storage Keywords.Keyword reachable from global A global variable does not satisfy its annotations when control is transferred. (Use -globstate to inhibit warning) keywords.c:60:11: Storage Keywords.Keyword released
0
1252
by: Jason Lehman | last post by:
When testing on my local machine, the session_start fires fine. I try storing a value to my database, creating a timestamped text file, and writing a line of text to a general log file. All of these work. When I transfer my site to my webhost, all of these no longer function within the session_start. All of these functions work correctly when triggered by button clicks or page redirects, the session_start simply won't fire. I have 3...
22
4066
by: pemo | last post by:
ISO C does not allow extra ';' outside of a function int n;; int main(void) { .... } Anyone care to enlighten me as to why ISO C does not allow this, but
6
1965
by: comp.lang.php | last post by:
I am using session_start() on index.php and for some reason sometimes it'll fail. No warnings, no errors, no notices, not even after prepending error_reporting(E_ALL) and ini_set('display_errors', TRUE) before session_start() do I see anything, it just plain dies. I used LiveHTTPHeaders to verify that I am getting a 200 OK response, thus everything seems OK except that it's dying on session_start(). Sometimes.
27
3129
by: Terry | last post by:
I am getting the following warning for the below function. I understand what it means but how do I handle a null reference? Then how do I pass the resulting value? Regards Warning 1 Function 'Dec2hms' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
2
16932
by: techjohnny | last post by:
Error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jplane/certcent/phpweb/quiz/index.php on line 21 PHP CODE:
92
6256
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
10
13246
by: asm23 | last post by:
Hi, I'm using Intel C++ compiler 9 to compiler a project. But, there are a lot of warning saying like "virtual function override intended....". I searched old messages in Google groups, someone already talk about this issue. But I still confused.. This is the simple test code I copied from these messages //////////////////////////////////////////////////////////////////// class Base { virtual void foo(); //*position A* };
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.