protected function allowedSessionsExceeded($orderedSessions, $allowableSessions, SessionRegistry $registry)
    {
        if ($this->errorIfMaximumExceeded) {
            throw new MaxSessionsExceededException(sprintf('Maximum number of sessions (%s) exceeded', $allowableSessions));
        }

        // Expire oldest session
        $orderedSessionsVector = array_values($orderedSessions);
        for ($i = $allowableSessions - 1, $countSessions = count($orderedSessionsVector); $i < $countSessions; $i++) {
            $registry->expireNow($orderedSessionsVector[$i]->getSessionId());
        }
    }