SimpleSAML_SessionHandlerCookie::isValidSessionID PHP Method

isValidSessionID() private static method

This static function validates a session id. A session id is valid if it only consists of characters which are allowed in a session id and it is the correct length.
private static isValidSessionID ( string $session_id ) : boolean
$session_id string The session ID we should validate.
return boolean True if this session ID is valid, false otherwise.
    private static function isValidSessionID($session_id)
    {
        if (!is_string($session_id)) {
            return false;
        }
        if (strlen($session_id) != 32) {
            return false;
        }
        if (preg_match('/[^0-9a-f]/', $session_id)) {
            return false;
        }
        return true;
    }