protected function recycleTokens()
{
if (!$this->expire_old) {
// This is turned off.
return $this;
}
// Sort by creation time
\uasort($this->session[$this->sessionIndex], function ($a, $b) : int {
return (int) ($a['created'] <=> $b['created']);
});
while (\count($this->session[$this->sessionIndex]) > $this->recycle_after) {
// Let's knock off the oldest one
\array_shift($this->session[$this->sessionIndex]);
}
return $this;
}