mirror of
https://github.com/kevachat/npsapp.git
synced 2025-01-28 07:44:16 +00:00
cleanup expired sessions
This commit is contained in:
parent
e01aebd66d
commit
ba90183547
@ -21,6 +21,7 @@
|
||||
},
|
||||
"session":
|
||||
{
|
||||
"timeout":3600,
|
||||
"captcha":
|
||||
{
|
||||
"length":3,
|
||||
|
@ -35,7 +35,18 @@ $server->setWelcome(
|
||||
global $config;
|
||||
global $session;
|
||||
|
||||
// Init session
|
||||
// Cleanup expired sessions
|
||||
foreach ($session as $key => $value)
|
||||
{
|
||||
if ($value['time'] + $config->nps->session->timeout < time())
|
||||
{
|
||||
unset(
|
||||
$session[$key]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Init new session
|
||||
$session[$connect] =
|
||||
[
|
||||
'time' => time(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user