public function set($key, $value, $params = array()) {
        $expire = 0;
        $path = null;
        $domain = null;
        $secure = false;
        $httponly = false;

        if (isset($params['expire'])) {
            $expire = $params['expire'];
        }
        if (isset($params['path'])) {
            $path = $params['path'];
        }
        if (isset($params['domain'])) {
            $domain = $params['domain'];
        }
        if (isset($params['secure'])) {
            $secure = $params['secure'];
        }
        if (isset($params['httponly'])) {
            $httponly = $params['httponly'];
        }

        setcookie($key, serialize($value), $expire, $path, $domain, $secure, $httponly);
    }