mirror of
https://github.com/kevachat/npsapp.git
synced 2025-01-29 16:24:17 +00:00
cleanup expired sessions
This commit is contained in:
parent
e01aebd66d
commit
ba90183547
@ -21,6 +21,7 @@
|
|||||||
},
|
},
|
||||||
"session":
|
"session":
|
||||||
{
|
{
|
||||||
|
"timeout":3600,
|
||||||
"captcha":
|
"captcha":
|
||||||
{
|
{
|
||||||
"length":3,
|
"length":3,
|
||||||
|
@ -35,7 +35,18 @@ $server->setWelcome(
|
|||||||
global $config;
|
global $config;
|
||||||
global $session;
|
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] =
|
$session[$connect] =
|
||||||
[
|
[
|
||||||
'time' => time(),
|
'time' => time(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user