Foros del Web » Programando para Internet » PHP »

Problemas con sesiones...

Estas en el tema de Problemas con sesiones... en el foro de PHP en Foros del Web. No comprendo el por qué del siguiente error: Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at F:\Archivos de programa\Apache ...
  #1 (permalink)  
Antiguo 23/06/2005, 14:00
 
Fecha de Ingreso: marzo-2005
Mensajes: 162
Antigüedad: 19 años, 1 mes
Puntos: 0
Problemas con sesiones...

No comprendo el por qué del siguiente error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at F:\Archivos de programa\Apache Group\Apache2\htdocs\pagina web\estructura.php:12) in F:\Archivos de programa\Apache Group\Apache2\htdocs\pagina web\aut_verifica.inc.php on line 119

Estoy trabajando con un autentificador de usuarios y ese mensaje me lo genera cuando un usuario accesa con nombre de user y password correctos.

Donde autentifico a un usuario y hago el inicio de sesiones es el sig. archivo:
Código PHP:
//"aut_verifica.inc.php
if (isset($_POST['user']) && isset($_POST['pass'])) {
............................................
 
session_name($usuarios_sesion);
 
session_start();
 
session_cache_limiter('nocache,private');
 
$_SESSION['usuario_id']=$usuario_datos['ID'];
 
$_SESSION['usuario_nivel']=$usuario_datos['nivel_acceso'];
 
$_SESSION['usuario_login']=$usuario_datos['usuario'];
 
$_SESSION['usuario_password']=$usuario_datos['pass'];
 
Header ("Location: $redir?mod=acceso");
 exit;
} else {

//SE SUPONE QUE AQUI NO DEBERIA DE ENTRAR PORQUE "user" Y "pass" FUERON CORRECTOS. 
//ESTA PARTE LA UTILIZO PARA QUE DESPUES DE HABER CERRADO LA SESIÓN
//Y UN USUARIO DE "ATRAS" CON SU NAVEGADOR PUES ME GENERE EL MENSAJE DE ACCESO INCORRECTO.

session_name($usuarios_sesion);
session_start();//ESTA LA LINEA DE ERROR QUE INDICA 
                    //EL MENSAJE QUE EN UN PRINCIPIO MOSTRÉ.
   
if (!isset($_SESSION['usuario_login']) && !isset($_SESSION  ['usuario_password'])){
      
session_destroy();
      die (
"Error cod.: 2 - Acceso incorrecto!");
      exit;
   }

Este es el otro archivo q c indica en el mensaje de error. Pero en este no hay más que puro código HTML y un poco de PHP
Código PHP:
//"estructura.php"
<html>
<head>
<title>Mi sitio</title>
<!--<basefont color="#FFFFFF" face="Verdana" />-->
    <style type="text/css">
<!--
.botones {...........}
-->
</style>
<script languaje="javascript">
    function deshabilita(form)
    {........................}
</script>
</head>
<body leftmargin="0" bottommargin="0" marginheight="0" marginwidth="0" topmargin="0">
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><td width="21%" rowspan="2" background="images/fondo.jpg" align="center" valign="top"> <? include('aut_index.php'?></td>
<td width="79%" align="left" valign="top" height="65"><?php include('superior.htm'); ?></td>
</tr>
<tr><td valign="top" height="935">
<? if (file_exists$path_inicio )) include( $path_inicio );
else die(
'Error al cargar el módulo <b>'.$modulo.'</b>. No existe el archivo <b>'.$conf[$modulo]['archivo'].'</b>'); ?></td>
</tr>
</table>
</body>
</html>
Cómo ven??? porque yo nomás no encuentro el error.

Salu2

Última edición por Ultra Violeta; 23/06/2005 a las 14:11
  #2 (permalink)  
Antiguo 23/06/2005, 15:49
Avatar de dwaks  
Fecha de Ingreso: agosto-2002
Ubicación: Panamá
Mensajes: 962
Antigüedad: 21 años, 8 meses
Puntos: 15
Este archivo <? include('aut_index.php') ?> debe ser ingresado antes de cualquier tag HTML ya que la funcion session_start() se debe especificar antes de cualquier envio de informacion al cliente.

Solo colocalo en la primera linea y listo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:32.