Airship\Engine\Security\CSRF::recycleTokens PHP 메소드

recycleTokens() 보호된 메소드

Enforce an upper limit on the number of tokens stored in session state by removing the oldest tokens first.
protected recycleTokens ( )
    protected function recycleTokens()
    {
        if (!$this->expireOld) {
            // This is turned off.
            return;
        }
        // Sort by creation time
        \uasort($_SESSION[$this->sessionIndex], function (array $a, array $b) : int {
            return (int) ($a['created'] <=> $b['created']);
        });
        if (\count($_SESSION[$this->sessionIndex]) > $this->recycleAfter) {
            // Let's knock off the oldest one
            \array_shift($_SESSION[$this->sessionIndex]);
        }
    }