diff --git a/lib/context.js b/lib/context.js index 410996b..5d547af 100644 --- a/lib/context.js +++ b/lib/context.js @@ -279,7 +279,12 @@ class ContextSession { const externalKey = this.externalKey; if (externalKey) await this.store.destroy(externalKey); - ctx.cookies.set(key, '', opts); + + if (opts.externalKey) { + opts.externalKey.set(ctx, ''); + } else { + ctx.cookies.set(key, '', opts); + } } /**