Skip to content

Commit 991b7ee

Browse files
kennethtxytqwdougwilson
authored andcommitted
Add debug log for pathname mismatch
closes #840
1 parent 408229e commit 991b7ee

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
unreleased
22
==========
33

4+
* Add debug log for pathname mismatch
45
* Add `partitioned` to `cookie` options
56
* Add `priority` to `cookie` options
67
* Fix handling errors from setting cookie

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,11 @@ function session(options) {
193193

194194
// pathname mismatch
195195
var originalPath = parseUrl.original(req).pathname || '/'
196-
if (originalPath.indexOf(cookieOptions.path || '/') !== 0) return next();
196+
if (originalPath.indexOf(cookieOptions.path || '/') !== 0) {
197+
debug('pathname mismatch')
198+
next()
199+
return
200+
}
197201

198202
// ensure a secret is available or bail
199203
if (!secret && !req.secret) {

0 commit comments

Comments
 (0)