$interval =
implode($separator,
['', "{
$max_lifetime} second", ''
]);
return $this->db->
table($this->table
)->
where('timestamp <', "now() - INTERVAL {
$interval}", false
)->
delete() ? 1 :
$this->
fail();
} /**
* Lock the session.
*/
protected function lockSession(string
$sessionID): bool
{ $arg = "hashtext('{
$sessionID}')" .
($this->matchIP ? ", hashtext('{
$this->ipAddress
}')" : ''
);
if ($this->db->
simpleQuery("SELECT pg_advisory_lock({
$arg})"
)) { $this->lock =
$arg;
return true;
} return $this->
fail();
} /**
* Releases the lock, if any.
*/