diff --git a/index.js b/index.js index d41b2378..19a8a0e7 100644 --- a/index.js +++ b/index.js @@ -452,6 +452,12 @@ function session(options) { return false; } + // skip save if flag is set + if (req.session.skipNextSave) { + delete req.session.skipNextSave; + return false; + } + return !saveUninitializedSession && !savedHash && cookieId !== req.sessionID ? isModified(req.session) : !isSaved(req.session)