Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/04/2004, 10:43
dgonzalez
 
Fecha de Ingreso: abril-2004
Mensajes: 3
Antigüedad: 20 años
Puntos: 0
Problemas con las sesiones en PHP

Hola, tengo el siguiente problema. Tengo 2 archivos php, authen.php e index.php. En el primero, intento hacer un login, y cuando el usuario se ha logado correctamente, lo redirecciono al index. Aqui viene el problema, que no me reconoce la variable de sesion $_SESSION['logado'] que he definido en authen.php

track_vars y register_globals estan activados (register_globals lo necesito tener activado). para que mas informacion os pongo el codigo que tengo al inicio de los 2 archivos:

AUTHEN.PHP:
**************************************************
<?php
if(!session_id()){
session_start();
}
if (file_exists('includes/configure.php')) include('includes/configure.php');
if (file_exists('configure.php')) include('configure.php');

if (isset($submit))
{
if ((ADMIN_USERNAME == $usuario) && (ADMIN_PASSWORD == $contrasenna))
{
$_SESSION['logado']=true;
if (file_exists('index.php')){
header("Location: index.php?PHPSESSID=" . session_id());
}
else{
header("Location: ../index.php?PHPSESSID=" . session_id());
}
exit;
}
else
$_SESSION['logado']=false;
}
**************************************************

y en index.php:
**************************************************
if ((!isset($_SESSION['logado'])) || ($_SESSION['logado']!=1))
{


if (file_exists('authen.php'))
{
header("Location: authen.php");
}
else{
header("Location: includes/authen.php");
}

}
else{ (aqui se cargaria la pagina si estuviese logado) }
********************************************
gracias de antemano