Jump to content

$_SESSION[logintime]=time() problem


tobimichigan

Recommended Posts

Hello Gurus,
Please could someone kindly point out what is really wrong here?

[code<?php 
include('cnx.php');
//session_start();
$session_logout = $_SESSION['logintime'] + 30;
if($_SESSION['logintime'] > $session_logout){
header("location:Expired.php");
}else{
$_SESSION['logintime'] = time();
}
if(!session_is_registered(username)){
header("location:Not_Logged.php");
}
?>

When I output  $_SESSION[logintime], it reads 1269419494 for output which does not translate to a time() function. Hence even after the  $session_logout = $_SESSION['logintime'] + 30; count expires the page is still open rather than auto logged out. Please can someone tell me what I am doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/196331-_sessionlogintimetime-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.