The PHP script is as follows:
<?php // continue.php
ini_set('session.gc_maxlifetime', 5);
session_start();
echo ini_get('session.gc_maxlifetime');
// wait for 7 seconds
usleep(7000000);
if (isset($_SESSION['username']))
{
$username = $_SESSION['username'];
$password = $_SESSION['password'];
$forename = $_SESSION['forename'];
$surname = $_SESSION['surname'];
echo "Welcome back $forename.<br />
Your full name is $forename $surname.<br />
Your username is '$username'
and your password is '$password'.";
}
else echo "Please <a href=authenticate2.php>click here</a> to log in.";
?>
Based on the timeout (i.e. 5 seconds), the script should not print out anything. However, I still receive the following message
5Welcome back Bill. Your full name is Bill Smith. Your username is 'bsmith' and your password is 'mysecret'.
It seems that the line ini_set('session.gc_maxlifetime', 5) doesn't work as it should be. I am using windowsXP + XAMMP.
May you tell me how to make it work?
Thank you
session_start()
populates the$_SESSION
array? Do you have a URL that confirms this? – Margarettmargaretta