public function checkCode($code)
    {
        $res = $this->twofactorAdapter->check($code);

        if($res)
        {
            setcookie('twofactorDir-' . $this->dir, $this->cookieCode, 0, "/");
            self::redirect();
        }

        return $res;
    }