Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
When i open the page i get the next message
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/numat/domains/numata.com.ar/public_html/index.php:1) in /home/numat/domains/numata.com.ar/public_html/verific.php on line 3
the firts lines of index are:
<? include("verific.php");
if ($_SESSION["autentificado"] == "YES") {
include("backend/connect.php");
$result = mysql_query("SELECT * FROM users WHERE session_client='$loginUser'");
$reg = mysql_fetch_object($result);
$username_user = $reg->username_user;
$_SESSION["usuario"]=$username_user;
$empresa = $reg->empresa_user;
$name = $reg->nombre_user;
$direccion = $reg->direccion_user;
$telefono = $reg->telefono_user;
$email = $reg->email_user;
$activo = $reg->activado_user;
}
?>
And the first lines of verific are<?
session_name("loginUser");
session_start();
if ($_SESSION["autentificado"] == "YES") {
$fechaGuardada = $_SESSION["ultimoAcceso"];
$ahora = date("Y-n-j H:i:s");
$tiempo_transcurrido = (strtotime($ahora)-strtotime($fechaGuardada));
if($tiempo_transcurrido >= 600) {
include("logout_user.php");
}else {
$_SESSION["ultimoAcceso"] = $ahora;
}
}
?>Can anyone tell me what's the problem??

On line 1 session_name() is attempting to set the session name. But, you don't start the session until line 2. reverse those two lines and it should fix the problem.
<?
session_start();
session_name("loginUser");
if ($_SESSION["autentificado"] == "YES") {
$fechaGuardada = $_SESSION["ultimoAcceso"];
$ahora = date("Y-n-j H:i:s");
$tiempo_transcurrido = (strtotime($ahora)-strtotime($fechaGuardada));
if($tiempo_transcurrido >= 600) {
include("logout_user.php");
}else {
$_SESSION["ultimoAcceso"] = $ahora;
}
}
?>Michael J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |