It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

login using sessionid or time

Moderator: Malcolm

login using sessionid or time

Postby ravi9510 on Tue Sep 20, 2011 6:50 am

hi all,
i have written a code in php using sessions.below is the code......

Code: Select all
<?php
if(!isset($_SESSION))
{
session_start();
}
$now = time();
$limit = $now;
if(isset($_SESSION['last_activity']) && ($_SESSION['last_activity'] < $limit))
{
$_SESSION = array();
header('Location:logout.php');
exit;
}
else
{
//the current time
$_SESSION['last_activity'] = $now;
}
?>
.
tell me how to modify in the above code that if the user is entering for first
time then using time() or sessionid it should be stored
or else if he is entering for first time then using current time() or sessionid
it must be stored.....
ravi9510
 
Posts: 11
Joined: Tue Aug 09, 2011 12:42 pm

Who is online

Users browsing this forum: No registered users and 0 guests