public function csrf($check = false, $force = false)
    {
        if ($this->config['csrf'] !== true) {
            return !empty($check) ? true : '';
        }

        if (session_id() == '' && $this->config['auto_session'] === true) {
            @session_start();
        }

        if ($check === false) {
            $current_token = $this->get_csrf_token();

            if (($current_token !== false && $force) || $current_token === false) {
                $token = sha1(uniqid(microtime(true), true));

                $_SESSION['phery'] = array(
                    'csrf' => $token
                );

                $token = base64_encode($token);
            } else {
                $token = base64_encode($_SESSION['phery']['csrf']);
            }

            return "<meta id=\"csrf-token\" name=\"csrf-token\" content=\"{$token}\" />\n";
        } else {
            if (empty($_SESSION['phery']['csrf'])) {
                return false;
            }

            return $_SESSION['phery']['csrf'] === base64_decode($check, true);
        }
    }