diff --git a/index.js b/index.js index 3672dfc..ba9c7d2 100644 --- a/index.js +++ b/index.js @@ -116,6 +116,11 @@ Cookies.prototype.set = function(name, value, opts) { return this }; +Cookies.prototype.remove = function(name, options) { + var opts = Object.assign({}, 'object' === typeof options ? options : {}, {maxAge:0}) + return this.set(name, null, opts) +}; + function Cookie(name, value, attrs) { if (!fieldContentRegExp.test(name)) { throw new TypeError('argument name is invalid');