Hi,
I'm changing the session-directory (originally to count users).
If any user refreshes his page, the timestamps of the session files
are checked, if it's older than x min, it's deleted.
Afterwards I touch() the user's own file to refresh it.
session_save_path("./sessions");
session_start();
$sess_dir_str = "sessions/";
$sess_dir = opendir($sess_dir_str);
while ($sess = readdir ($sess_dir))
{
if (($sess != ".") && ($sess != "..") && ((fileatime($sess_dir_str . $sess)+1800) < time()))
{
// 1800 = 60sec * 30 = 30min
unlink($sess_dir_str . $sess);
}
}
closedir ($sess_dir);
touch ($sess_dir_str . "sess_" . session_id());
Originally posted by veena
I know this is possible in php.
I doubt that. If the user didn't send the information to the server, PHP can't do anything.
_Maybe_ Javascript can help