@plotdb/express-session 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,994 @@
1
+ # @plotdb/express-session
2
+
3
+ *Note* This is a experimental fork from original express-session, trying to solve mysterious user session issue.
4
+
5
+ It does one simple thing: throw an exception (duck-typed lderror 1029) when invalid signature is detected.
6
+
7
+ Following are the original README from expression-session.
8
+
9
+
10
+ # express-session
11
+
12
+ [![NPM Version][npm-version-image]][npm-url]
13
+ [![NPM Downloads][npm-downloads-image]][node-url]
14
+ [![Build Status][ci-image]][ci-url]
15
+ [![Test Coverage][coveralls-image]][coveralls-url]
16
+
17
+ ## Installation
18
+
19
+ This is a [Node.js](https://nodejs.org/en/) module available through the
20
+ [npm registry](https://www.npmjs.com/). Installation is done using the
21
+ [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
22
+
23
+ ```sh
24
+ $ npm install express-session
25
+ ```
26
+
27
+ ## API
28
+
29
+ ```js
30
+ var session = require('express-session')
31
+ ```
32
+
33
+ ### session(options)
34
+
35
+ Create a session middleware with the given `options`.
36
+
37
+ **Note** Session data is _not_ saved in the cookie itself, just the session ID.
38
+ Session data is stored server-side.
39
+
40
+ **Note** Since version 1.5.0, the [`cookie-parser` middleware](https://www.npmjs.com/package/cookie-parser)
41
+ no longer needs to be used for this module to work. This module now directly reads
42
+ and writes cookies on `req`/`res`. Using `cookie-parser` may result in issues
43
+ if the `secret` is not the same between this module and `cookie-parser`.
44
+
45
+ **Warning** The default server-side session storage, `MemoryStore`, is _purposely_
46
+ not designed for a production environment. It will leak memory under most
47
+ conditions, does not scale past a single process, and is meant for debugging and
48
+ developing.
49
+
50
+ For a list of stores, see [compatible session stores](#compatible-session-stores).
51
+
52
+ #### Options
53
+
54
+ `express-session` accepts these properties in the options object.
55
+
56
+ ##### cookie
57
+
58
+ Settings object for the session ID cookie. The default value is
59
+ `{ path: '/', httpOnly: true, secure: false, maxAge: null }`.
60
+
61
+ The following are options that can be set in this object.
62
+
63
+ ##### cookie.domain
64
+
65
+ Specifies the value for the `Domain` `Set-Cookie` attribute. By default, no domain
66
+ is set, and most clients will consider the cookie to apply to only the current
67
+ domain.
68
+
69
+ ##### cookie.expires
70
+
71
+ Specifies the `Date` object to be the value for the `Expires` `Set-Cookie` attribute.
72
+ By default, no expiration is set, and most clients will consider this a
73
+ "non-persistent cookie" and will delete it on a condition like exiting a web browser
74
+ application.
75
+
76
+ **Note** If both `expires` and `maxAge` are set in the options, then the last one
77
+ defined in the object is what is used.
78
+
79
+ **Note** The `expires` option should not be set directly; instead only use the `maxAge`
80
+ option.
81
+
82
+ ##### cookie.httpOnly
83
+
84
+ Specifies the `boolean` value for the `HttpOnly` `Set-Cookie` attribute. When truthy,
85
+ the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly`
86
+ attribute is set.
87
+
88
+ **Note** be careful when setting this to `true`, as compliant clients will not allow
89
+ client-side JavaScript to see the cookie in `document.cookie`.
90
+
91
+ ##### cookie.maxAge
92
+
93
+ Specifies the `number` (in milliseconds) to use when calculating the `Expires`
94
+ `Set-Cookie` attribute. This is done by taking the current server time and adding
95
+ `maxAge` milliseconds to the value to calculate an `Expires` datetime. By default,
96
+ no maximum age is set.
97
+
98
+ **Note** If both `expires` and `maxAge` are set in the options, then the last one
99
+ defined in the object is what is used.
100
+
101
+ ##### cookie.path
102
+
103
+ Specifies the value for the `Path` `Set-Cookie`. By default, this is set to `'/'`, which
104
+ is the root path of the domain.
105
+
106
+ ##### cookie.sameSite
107
+
108
+ Specifies the `boolean` or `string` to be the value for the `SameSite` `Set-Cookie` attribute.
109
+ By default, this is `false`.
110
+
111
+ - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
112
+ - `false` will not set the `SameSite` attribute.
113
+ - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
114
+ - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
115
+ - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
116
+
117
+ More information about the different enforcement levels can be found in
118
+ [the specification][rfc-6265bis-03-4.1.2.7].
119
+
120
+ **Note** This is an attribute that has not yet been fully standardized, and may change in
121
+ the future. This also means many clients may ignore this attribute until they understand it.
122
+
123
+ **Note** There is a [draft spec](https://tools.ietf.org/html/draft-west-cookie-incrementalism-01)
124
+ that requires that the `Secure` attribute be set to `true` when the `SameSite` attribute has been
125
+ set to `'none'`. Some web browsers or other clients may be adopting this specification.
126
+
127
+ ##### cookie.secure
128
+
129
+ Specifies the `boolean` value for the `Secure` `Set-Cookie` attribute. When truthy,
130
+ the `Secure` attribute is set, otherwise it is not. By default, the `Secure`
131
+ attribute is not set.
132
+
133
+ **Note** be careful when setting this to `true`, as compliant clients will not send
134
+ the cookie back to the server in the future if the browser does not have an HTTPS
135
+ connection.
136
+
137
+ Please note that `secure: true` is a **recommended** option. However, it requires
138
+ an https-enabled website, i.e., HTTPS is necessary for secure cookies. If `secure`
139
+ is set, and you access your site over HTTP, the cookie will not be set. If you
140
+ have your node.js behind a proxy and are using `secure: true`, you need to set
141
+ "trust proxy" in express:
142
+
143
+ ```js
144
+ var app = express()
145
+ app.set('trust proxy', 1) // trust first proxy
146
+ app.use(session({
147
+ secret: 'keyboard cat',
148
+ resave: false,
149
+ saveUninitialized: true,
150
+ cookie: { secure: true }
151
+ }))
152
+ ```
153
+
154
+ For using secure cookies in production, but allowing for testing in development,
155
+ the following is an example of enabling this setup based on `NODE_ENV` in express:
156
+
157
+ ```js
158
+ var app = express()
159
+ var sess = {
160
+ secret: 'keyboard cat',
161
+ cookie: {}
162
+ }
163
+
164
+ if (app.get('env') === 'production') {
165
+ app.set('trust proxy', 1) // trust first proxy
166
+ sess.cookie.secure = true // serve secure cookies
167
+ }
168
+
169
+ app.use(session(sess))
170
+ ```
171
+
172
+ The `cookie.secure` option can also be set to the special value `'auto'` to have
173
+ this setting automatically match the determined security of the connection. Be
174
+ careful when using this setting if the site is available both as HTTP and HTTPS,
175
+ as once the cookie is set on HTTPS, it will no longer be visible over HTTP. This
176
+ is useful when the Express `"trust proxy"` setting is properly setup to simplify
177
+ development vs production configuration.
178
+
179
+ ##### genid
180
+
181
+ Function to call to generate a new session ID. Provide a function that returns
182
+ a string that will be used as a session ID. The function is given `req` as the
183
+ first argument if you want to use some value attached to `req` when generating
184
+ the ID.
185
+
186
+ The default value is a function which uses the `uid-safe` library to generate IDs.
187
+
188
+ **NOTE** be careful to generate unique IDs so your sessions do not conflict.
189
+
190
+ ```js
191
+ app.use(session({
192
+ genid: function(req) {
193
+ return genuuid() // use UUIDs for session IDs
194
+ },
195
+ secret: 'keyboard cat'
196
+ }))
197
+ ```
198
+
199
+ ##### name
200
+
201
+ The name of the session ID cookie to set in the response (and read from in the
202
+ request).
203
+
204
+ The default value is `'connect.sid'`.
205
+
206
+ **Note** if you have multiple apps running on the same hostname (this is just
207
+ the name, i.e. `localhost` or `127.0.0.1`; different schemes and ports do not
208
+ name a different hostname), then you need to separate the session cookies from
209
+ each other. The simplest method is to simply set different `name`s per app.
210
+
211
+ ##### proxy
212
+
213
+ Trust the reverse proxy when setting secure cookies (via the "X-Forwarded-Proto"
214
+ header).
215
+
216
+ The default value is `undefined`.
217
+
218
+ - `true` The "X-Forwarded-Proto" header will be used.
219
+ - `false` All headers are ignored and the connection is considered secure only
220
+ if there is a direct TLS/SSL connection.
221
+ - `undefined` Uses the "trust proxy" setting from express
222
+
223
+ ##### resave
224
+
225
+ Forces the session to be saved back to the session store, even if the session
226
+ was never modified during the request. Depending on your store this may be
227
+ necessary, but it can also create race conditions where a client makes two
228
+ parallel requests to your server and changes made to the session in one
229
+ request may get overwritten when the other request ends, even if it made no
230
+ changes (this behavior also depends on what store you're using).
231
+
232
+ The default value is `true`, but using the default has been deprecated,
233
+ as the default will change in the future. Please research into this setting
234
+ and choose what is appropriate to your use-case. Typically, you'll want
235
+ `false`.
236
+
237
+ How do I know if this is necessary for my store? The best way to know is to
238
+ check with your store if it implements the `touch` method. If it does, then
239
+ you can safely set `resave: false`. If it does not implement the `touch`
240
+ method and your store sets an expiration date on stored sessions, then you
241
+ likely need `resave: true`.
242
+
243
+ ##### rolling
244
+
245
+ Force the session identifier cookie to be set on every response. The expiration
246
+ is reset to the original [`maxAge`](#cookiemaxage), resetting the expiration
247
+ countdown.
248
+
249
+ The default value is `false`.
250
+
251
+ With this enabled, the session identifier cookie will expire in
252
+ [`maxAge`](#cookiemaxage) since the last response was sent instead of in
253
+ [`maxAge`](#cookiemaxage) since the session was last modified by the server.
254
+
255
+ This is typically used in conjuction with short, non-session-length
256
+ [`maxAge`](#cookiemaxage) values to provide a quick timeout of the session data
257
+ with reduced potential of it occurring during on going server interactions.
258
+
259
+ **Note** When this option is set to `true` but the `saveUninitialized` option is
260
+ set to `false`, the cookie will not be set on a response with an uninitialized
261
+ session. This option only modifies the behavior when an existing session was
262
+ loaded for the request.
263
+
264
+ ##### saveUninitialized
265
+
266
+ Forces a session that is "uninitialized" to be saved to the store. A session is
267
+ uninitialized when it is new but not modified. Choosing `false` is useful for
268
+ implementing login sessions, reducing server storage usage, or complying with
269
+ laws that require permission before setting a cookie. Choosing `false` will also
270
+ help with race conditions where a client makes multiple parallel requests
271
+ without a session.
272
+
273
+ The default value is `true`, but using the default has been deprecated, as the
274
+ default will change in the future. Please research into this setting and
275
+ choose what is appropriate to your use-case.
276
+
277
+ **Note** if you are using Session in conjunction with PassportJS, Passport
278
+ will add an empty Passport object to the session for use after a user is
279
+ authenticated, which will be treated as a modification to the session, causing
280
+ it to be saved. *This has been fixed in PassportJS 0.3.0*
281
+
282
+ ##### secret
283
+
284
+ **Required option**
285
+
286
+ This is the secret used to sign the session ID cookie. This can be either a string
287
+ for a single secret, or an array of multiple secrets. If an array of secrets is
288
+ provided, only the first element will be used to sign the session ID cookie, while
289
+ all the elements will be considered when verifying the signature in requests. The
290
+ secret itself should be not easily parsed by a human and would best be a random set
291
+ of characters. A best practice may include:
292
+
293
+ - The use of environment variables to store the secret, ensuring the secret itself
294
+ does not exist in your repository.
295
+ - Periodic updates of the secret, while ensuring the previous secret is in the
296
+ array.
297
+
298
+ Using a secret that cannot be guessed will reduce the ability to hijack a session to
299
+ only guessing the session ID (as determined by the `genid` option).
300
+
301
+ Changing the secret value will invalidate all existing sessions. In order to rotate
302
+ the secret without invalidating sessions, provide an array of secrets, with the new
303
+ secret as first element of the array, and including previous secrets as the later
304
+ elements.
305
+
306
+ ##### store
307
+
308
+ The session store instance, defaults to a new `MemoryStore` instance.
309
+
310
+ ##### unset
311
+
312
+ Control the result of unsetting `req.session` (through `delete`, setting to `null`,
313
+ etc.).
314
+
315
+ The default value is `'keep'`.
316
+
317
+ - `'destroy'` The session will be destroyed (deleted) when the response ends.
318
+ - `'keep'` The session in the store will be kept, but modifications made during
319
+ the request are ignored and not saved.
320
+
321
+ ### req.session
322
+
323
+ To store or access session data, simply use the request property `req.session`,
324
+ which is (generally) serialized as JSON by the store, so nested objects
325
+ are typically fine. For example below is a user-specific view counter:
326
+
327
+ ```js
328
+ // Use the session middleware
329
+ app.use(session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }}))
330
+
331
+ // Access the session as req.session
332
+ app.get('/', function(req, res, next) {
333
+ if (req.session.views) {
334
+ req.session.views++
335
+ res.setHeader('Content-Type', 'text/html')
336
+ res.write('<p>views: ' + req.session.views + '</p>')
337
+ res.write('<p>expires in: ' + (req.session.cookie.maxAge / 1000) + 's</p>')
338
+ res.end()
339
+ } else {
340
+ req.session.views = 1
341
+ res.end('welcome to the session demo. refresh!')
342
+ }
343
+ })
344
+ ```
345
+
346
+ #### Session.regenerate(callback)
347
+
348
+ To regenerate the session simply invoke the method. Once complete,
349
+ a new SID and `Session` instance will be initialized at `req.session`
350
+ and the `callback` will be invoked.
351
+
352
+ ```js
353
+ req.session.regenerate(function(err) {
354
+ // will have a new session here
355
+ })
356
+ ```
357
+
358
+ #### Session.destroy(callback)
359
+
360
+ Destroys the session and will unset the `req.session` property.
361
+ Once complete, the `callback` will be invoked.
362
+
363
+ ```js
364
+ req.session.destroy(function(err) {
365
+ // cannot access session here
366
+ })
367
+ ```
368
+
369
+ #### Session.reload(callback)
370
+
371
+ Reloads the session data from the store and re-populates the
372
+ `req.session` object. Once complete, the `callback` will be invoked.
373
+
374
+ ```js
375
+ req.session.reload(function(err) {
376
+ // session updated
377
+ })
378
+ ```
379
+
380
+ #### Session.save(callback)
381
+
382
+ Save the session back to the store, replacing the contents on the store with the
383
+ contents in memory (though a store may do something else--consult the store's
384
+ documentation for exact behavior).
385
+
386
+ This method is automatically called at the end of the HTTP response if the
387
+ session data has been altered (though this behavior can be altered with various
388
+ options in the middleware constructor). Because of this, typically this method
389
+ does not need to be called.
390
+
391
+ There are some cases where it is useful to call this method, for example,
392
+ redirects, long-lived requests or in WebSockets.
393
+
394
+ ```js
395
+ req.session.save(function(err) {
396
+ // session saved
397
+ })
398
+ ```
399
+
400
+ #### Session.touch()
401
+
402
+ Updates the `.maxAge` property. Typically this is
403
+ not necessary to call, as the session middleware does this for you.
404
+
405
+ ### req.session.id
406
+
407
+ Each session has a unique ID associated with it. This property is an
408
+ alias of [`req.sessionID`](#reqsessionid-1) and cannot be modified.
409
+ It has been added to make the session ID accessible from the `session`
410
+ object.
411
+
412
+ ### req.session.cookie
413
+
414
+ Each session has a unique cookie object accompany it. This allows
415
+ you to alter the session cookie per visitor. For example we can
416
+ set `req.session.cookie.expires` to `false` to enable the cookie
417
+ to remain for only the duration of the user-agent.
418
+
419
+ #### Cookie.maxAge
420
+
421
+ Alternatively `req.session.cookie.maxAge` will return the time
422
+ remaining in milliseconds, which we may also re-assign a new value
423
+ to adjust the `.expires` property appropriately. The following
424
+ are essentially equivalent
425
+
426
+ ```js
427
+ var hour = 3600000
428
+ req.session.cookie.expires = new Date(Date.now() + hour)
429
+ req.session.cookie.maxAge = hour
430
+ ```
431
+
432
+ For example when `maxAge` is set to `60000` (one minute), and 30 seconds
433
+ has elapsed it will return `30000` until the current request has completed,
434
+ at which time `req.session.touch()` is called to reset
435
+ `req.session.cookie.maxAge` to its original value.
436
+
437
+ ```js
438
+ req.session.cookie.maxAge // => 30000
439
+ ```
440
+
441
+ #### Cookie.originalMaxAge
442
+
443
+ The `req.session.cookie.originalMaxAge` property returns the original
444
+ `maxAge` (time-to-live), in milliseconds, of the session cookie.
445
+
446
+ ### req.sessionID
447
+
448
+ To get the ID of the loaded session, access the request property
449
+ `req.sessionID`. This is simply a read-only value set when a session
450
+ is loaded/created.
451
+
452
+ ## Session Store Implementation
453
+
454
+ Every session store _must_ be an `EventEmitter` and implement specific
455
+ methods. The following methods are the list of **required**, **recommended**,
456
+ and **optional**.
457
+
458
+ * Required methods are ones that this module will always call on the store.
459
+ * Recommended methods are ones that this module will call on the store if
460
+ available.
461
+ * Optional methods are ones this module does not call at all, but helps
462
+ present uniform stores to users.
463
+
464
+ For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo.
465
+
466
+ ### store.all(callback)
467
+
468
+ **Optional**
469
+
470
+ This optional method is used to get all sessions in the store as an array. The
471
+ `callback` should be called as `callback(error, sessions)`.
472
+
473
+ ### store.destroy(sid, callback)
474
+
475
+ **Required**
476
+
477
+ This required method is used to destroy/delete a session from the store given
478
+ a session ID (`sid`). The `callback` should be called as `callback(error)` once
479
+ the session is destroyed.
480
+
481
+ ### store.clear(callback)
482
+
483
+ **Optional**
484
+
485
+ This optional method is used to delete all sessions from the store. The
486
+ `callback` should be called as `callback(error)` once the store is cleared.
487
+
488
+ ### store.length(callback)
489
+
490
+ **Optional**
491
+
492
+ This optional method is used to get the count of all sessions in the store.
493
+ The `callback` should be called as `callback(error, len)`.
494
+
495
+ ### store.get(sid, callback)
496
+
497
+ **Required**
498
+
499
+ This required method is used to get a session from the store given a session
500
+ ID (`sid`). The `callback` should be called as `callback(error, session)`.
501
+
502
+ The `session` argument should be a session if found, otherwise `null` or
503
+ `undefined` if the session was not found (and there was no error). A special
504
+ case is made when `error.code === 'ENOENT'` to act like `callback(null, null)`.
505
+
506
+ ### store.set(sid, session, callback)
507
+
508
+ **Required**
509
+
510
+ This required method is used to upsert a session into the store given a
511
+ session ID (`sid`) and session (`session`) object. The callback should be
512
+ called as `callback(error)` once the session has been set in the store.
513
+
514
+ ### store.touch(sid, session, callback)
515
+
516
+ **Recommended**
517
+
518
+ This recommended method is used to "touch" a given session given a
519
+ session ID (`sid`) and session (`session`) object. The `callback` should be
520
+ called as `callback(error)` once the session has been touched.
521
+
522
+ This is primarily used when the store will automatically delete idle sessions
523
+ and this method is used to signal to the store the given session is active,
524
+ potentially resetting the idle timer.
525
+
526
+ ## Compatible Session Stores
527
+
528
+ The following modules implement a session store that is compatible with this
529
+ module. Please make a PR to add additional modules :)
530
+
531
+ [![★][aerospike-session-store-image] aerospike-session-store][aerospike-session-store-url] A session store using [Aerospike](http://www.aerospike.com/).
532
+
533
+ [aerospike-session-store-url]: https://www.npmjs.com/package/aerospike-session-store
534
+ [aerospike-session-store-image]: https://badgen.net/github/stars/aerospike/aerospike-session-store-expressjs?label=%E2%98%85
535
+
536
+ [![★][better-sqlite3-session-store-image] better-sqlite3-session-store][better-sqlite3-session-store-url] A session store based on [better-sqlite3](https://github.com/JoshuaWise/better-sqlite3).
537
+
538
+ [better-sqlite3-session-store-url]: https://www.npmjs.com/package/better-sqlite3-session-store
539
+ [better-sqlite3-session-store-image]: https://badgen.net/github/stars/timdaub/better-sqlite3-session-store?label=%E2%98%85
540
+
541
+ [![★][cassandra-store-image] cassandra-store][cassandra-store-url] An Apache Cassandra-based session store.
542
+
543
+ [cassandra-store-url]: https://www.npmjs.com/package/cassandra-store
544
+ [cassandra-store-image]: https://badgen.net/github/stars/webcc/cassandra-store?label=%E2%98%85
545
+
546
+ [![★][cluster-store-image] cluster-store][cluster-store-url] A wrapper for using in-process / embedded
547
+ stores - such as SQLite (via knex), leveldb, files, or memory - with node cluster (desirable for Raspberry Pi 2
548
+ and other multi-core embedded devices).
549
+
550
+ [cluster-store-url]: https://www.npmjs.com/package/cluster-store
551
+ [cluster-store-image]: https://badgen.net/github/stars/coolaj86/cluster-store?label=%E2%98%85
552
+
553
+ [![★][connect-arango-image] connect-arango][connect-arango-url] An ArangoDB-based session store.
554
+
555
+ [connect-arango-url]: https://www.npmjs.com/package/connect-arango
556
+ [connect-arango-image]: https://badgen.net/github/stars/AlexanderArvidsson/connect-arango?label=%E2%98%85
557
+
558
+ [![★][connect-azuretables-image] connect-azuretables][connect-azuretables-url] An [Azure Table Storage](https://azure.microsoft.com/en-gb/services/storage/tables/)-based session store.
559
+
560
+ [connect-azuretables-url]: https://www.npmjs.com/package/connect-azuretables
561
+ [connect-azuretables-image]: https://badgen.net/github/stars/mike-goodwin/connect-azuretables?label=%E2%98%85
562
+
563
+ [![★][connect-cloudant-store-image] connect-cloudant-store][connect-cloudant-store-url] An [IBM Cloudant](https://cloudant.com/)-based session store.
564
+
565
+ [connect-cloudant-store-url]: https://www.npmjs.com/package/connect-cloudant-store
566
+ [connect-cloudant-store-image]: https://badgen.net/github/stars/adriantanasa/connect-cloudant-store?label=%E2%98%85
567
+
568
+ [![★][connect-couchbase-image] connect-couchbase][connect-couchbase-url] A [couchbase](http://www.couchbase.com/)-based session store.
569
+
570
+ [connect-couchbase-url]: https://www.npmjs.com/package/connect-couchbase
571
+ [connect-couchbase-image]: https://badgen.net/github/stars/christophermina/connect-couchbase?label=%E2%98%85
572
+
573
+ [![★][connect-datacache-image] connect-datacache][connect-datacache-url] An [IBM Bluemix Data Cache](http://www.ibm.com/cloud-computing/bluemix/)-based session store.
574
+
575
+ [connect-datacache-url]: https://www.npmjs.com/package/connect-datacache
576
+ [connect-datacache-image]: https://badgen.net/github/stars/adriantanasa/connect-datacache?label=%E2%98%85
577
+
578
+ [![★][@google-cloud/connect-datastore-image] @google-cloud/connect-datastore][@google-cloud/connect-datastore-url] A [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/overview)-based session store.
579
+
580
+ [@google-cloud/connect-datastore-url]: https://www.npmjs.com/package/@google-cloud/connect-datastore
581
+ [@google-cloud/connect-datastore-image]: https://badgen.net/github/stars/GoogleCloudPlatform/cloud-datastore-session-node?label=%E2%98%85
582
+
583
+ [![★][connect-db2-image] connect-db2][connect-db2-url] An IBM DB2-based session store built using [ibm_db](https://www.npmjs.com/package/ibm_db) module.
584
+
585
+ [connect-db2-url]: https://www.npmjs.com/package/connect-db2
586
+ [connect-db2-image]: https://badgen.net/github/stars/wallali/connect-db2?label=%E2%98%85
587
+
588
+ [![★][connect-dynamodb-image] connect-dynamodb][connect-dynamodb-url] A DynamoDB-based session store.
589
+
590
+ [connect-dynamodb-url]: https://www.npmjs.com/package/connect-dynamodb
591
+ [connect-dynamodb-image]: https://badgen.net/github/stars/ca98am79/connect-dynamodb?label=%E2%98%85
592
+
593
+ [![★][@google-cloud/connect-firestore-image] @google-cloud/connect-firestore][@google-cloud/connect-firestore-url] A [Google Cloud Firestore](https://cloud.google.com/firestore/docs/overview)-based session store.
594
+
595
+ [@google-cloud/connect-firestore-url]: https://www.npmjs.com/package/@google-cloud/connect-firestore
596
+ [@google-cloud/connect-firestore-image]: https://badgen.net/github/stars/googleapis/nodejs-firestore-session?label=%E2%98%85
597
+
598
+ [![★][connect-hazelcast-image] connect-hazelcast][connect-hazelcast-url] Hazelcast session store for Connect and Express.
599
+
600
+ [connect-hazelcast-url]: https://www.npmjs.com/package/connect-hazelcast
601
+ [connect-hazelcast-image]: https://badgen.net/github/stars/huseyinbabal/connect-hazelcast?label=%E2%98%85
602
+
603
+ [![★][connect-loki-image] connect-loki][connect-loki-url] A Loki.js-based session store.
604
+
605
+ [connect-loki-url]: https://www.npmjs.com/package/connect-loki
606
+ [connect-loki-image]: https://badgen.net/github/stars/Requarks/connect-loki?label=%E2%98%85
607
+
608
+ [![★][connect-lowdb-image] connect-lowdb][connect-lowdb-url] A lowdb-based session store.
609
+
610
+ [connect-lowdb-url]: https://www.npmjs.com/package/connect-lowdb
611
+ [connect-lowdb-image]: https://badgen.net/github/stars/travishorn/connect-lowdb?label=%E2%98%85
612
+
613
+ [![★][connect-memcached-image] connect-memcached][connect-memcached-url] A memcached-based session store.
614
+
615
+ [connect-memcached-url]: https://www.npmjs.com/package/connect-memcached
616
+ [connect-memcached-image]: https://badgen.net/github/stars/balor/connect-memcached?label=%E2%98%85
617
+
618
+ [![★][connect-memjs-image] connect-memjs][connect-memjs-url] A memcached-based session store using
619
+ [memjs](https://www.npmjs.com/package/memjs) as the memcached client.
620
+
621
+ [connect-memjs-url]: https://www.npmjs.com/package/connect-memjs
622
+ [connect-memjs-image]: https://badgen.net/github/stars/liamdon/connect-memjs?label=%E2%98%85
623
+
624
+ [![★][connect-ml-image] connect-ml][connect-ml-url] A MarkLogic Server-based session store.
625
+
626
+ [connect-ml-url]: https://www.npmjs.com/package/connect-ml
627
+ [connect-ml-image]: https://badgen.net/github/stars/bluetorch/connect-ml?label=%E2%98%85
628
+
629
+ [![★][connect-monetdb-image] connect-monetdb][connect-monetdb-url] A MonetDB-based session store.
630
+
631
+ [connect-monetdb-url]: https://www.npmjs.com/package/connect-monetdb
632
+ [connect-monetdb-image]: https://badgen.net/github/stars/MonetDB/npm-connect-monetdb?label=%E2%98%85
633
+
634
+ [![★][connect-mongo-image] connect-mongo][connect-mongo-url] A MongoDB-based session store.
635
+
636
+ [connect-mongo-url]: https://www.npmjs.com/package/connect-mongo
637
+ [connect-mongo-image]: https://badgen.net/github/stars/kcbanner/connect-mongo?label=%E2%98%85
638
+
639
+ [![★][connect-mongodb-session-image] connect-mongodb-session][connect-mongodb-session-url] Lightweight MongoDB-based session store built and maintained by MongoDB.
640
+
641
+ [connect-mongodb-session-url]: https://www.npmjs.com/package/connect-mongodb-session
642
+ [connect-mongodb-session-image]: https://badgen.net/github/stars/mongodb-js/connect-mongodb-session?label=%E2%98%85
643
+
644
+ [![★][connect-mssql-v2-image] connect-mssql-v2][connect-mssql-v2-url] A Microsoft SQL Server-based session store based on [connect-mssql](https://www.npmjs.com/package/connect-mssql).
645
+
646
+ [connect-mssql-v2-url]: https://www.npmjs.com/package/connect-mssql-v2
647
+ [connect-mssql-v2-image]: https://badgen.net/github/stars/jluboff/connect-mssql-v2?label=%E2%98%85
648
+
649
+ [![★][connect-neo4j-image] connect-neo4j][connect-neo4j-url] A [Neo4j](https://neo4j.com)-based session store.
650
+
651
+ [connect-neo4j-url]: https://www.npmjs.com/package/connect-neo4j
652
+ [connect-neo4j-image]: https://badgen.net/github/stars/MaxAndersson/connect-neo4j?label=%E2%98%85
653
+
654
+ [![★][connect-pg-simple-image] connect-pg-simple][connect-pg-simple-url] A PostgreSQL-based session store.
655
+
656
+ [connect-pg-simple-url]: https://www.npmjs.com/package/connect-pg-simple
657
+ [connect-pg-simple-image]: https://badgen.net/github/stars/voxpelli/node-connect-pg-simple?label=%E2%98%85
658
+
659
+ [![★][connect-redis-image] connect-redis][connect-redis-url] A Redis-based session store.
660
+
661
+ [connect-redis-url]: https://www.npmjs.com/package/connect-redis
662
+ [connect-redis-image]: https://badgen.net/github/stars/tj/connect-redis?label=%E2%98%85
663
+
664
+ [![★][connect-session-firebase-image] connect-session-firebase][connect-session-firebase-url] A session store based on the [Firebase Realtime Database](https://firebase.google.com/docs/database/)
665
+
666
+ [connect-session-firebase-url]: https://www.npmjs.com/package/connect-session-firebase
667
+ [connect-session-firebase-image]: https://badgen.net/github/stars/benweier/connect-session-firebase?label=%E2%98%85
668
+
669
+ [![★][connect-session-knex-image] connect-session-knex][connect-session-knex-url] A session store using
670
+ [Knex.js](http://knexjs.org/), which is a SQL query builder for PostgreSQL, MySQL, MariaDB, SQLite3, and Oracle.
671
+
672
+ [connect-session-knex-url]: https://www.npmjs.com/package/connect-session-knex
673
+ [connect-session-knex-image]: https://badgen.net/github/stars/llambda/connect-session-knex?label=%E2%98%85
674
+
675
+ [![★][connect-session-sequelize-image] connect-session-sequelize][connect-session-sequelize-url] A session store using
676
+ [Sequelize.js](http://sequelizejs.com/), which is a Node.js / io.js ORM for PostgreSQL, MySQL, SQLite and MSSQL.
677
+
678
+ [connect-session-sequelize-url]: https://www.npmjs.com/package/connect-session-sequelize
679
+ [connect-session-sequelize-image]: https://badgen.net/github/stars/mweibel/connect-session-sequelize?label=%E2%98%85
680
+
681
+ [![★][connect-sqlite3-image] connect-sqlite3][connect-sqlite3-url] A [SQLite3](https://github.com/mapbox/node-sqlite3) session store modeled after the TJ's `connect-redis` store.
682
+
683
+ [connect-sqlite3-url]: https://www.npmjs.com/package/connect-sqlite3
684
+ [connect-sqlite3-image]: https://badgen.net/github/stars/rawberg/connect-sqlite3?label=%E2%98%85
685
+
686
+ [![★][connect-typeorm-image] connect-typeorm][connect-typeorm-url] A [TypeORM](https://github.com/typeorm/typeorm)-based session store.
687
+
688
+ [connect-typeorm-url]: https://www.npmjs.com/package/connect-typeorm
689
+ [connect-typeorm-image]: https://badgen.net/github/stars/makepost/connect-typeorm?label=%E2%98%85
690
+
691
+ [![★][couchdb-expression-image] couchdb-expression][couchdb-expression-url] A [CouchDB](https://couchdb.apache.org/)-based session store.
692
+
693
+ [couchdb-expression-url]: https://www.npmjs.com/package/couchdb-expression
694
+ [couchdb-expression-image]: https://badgen.net/github/stars/tkshnwesper/couchdb-expression?label=%E2%98%85
695
+
696
+ [![★][dynamodb-store-image] dynamodb-store][dynamodb-store-url] A DynamoDB-based session store.
697
+
698
+ [dynamodb-store-url]: https://www.npmjs.com/package/dynamodb-store
699
+ [dynamodb-store-image]: https://badgen.net/github/stars/rafaelrpinto/dynamodb-store?label=%E2%98%85
700
+
701
+ [![★][express-etcd-image] express-etcd][express-etcd-url] An [etcd](https://github.com/stianeikeland/node-etcd) based session store.
702
+
703
+ [express-etcd-url]: https://www.npmjs.com/package/express-etcd
704
+ [express-etcd-image]: https://badgen.net/github/stars/gildean/express-etcd?label=%E2%98%85
705
+
706
+ [![★][express-mysql-session-image] express-mysql-session][express-mysql-session-url] A session store using native
707
+ [MySQL](https://www.mysql.com/) via the [node-mysql](https://github.com/felixge/node-mysql) module.
708
+
709
+ [express-mysql-session-url]: https://www.npmjs.com/package/express-mysql-session
710
+ [express-mysql-session-image]: https://badgen.net/github/stars/chill117/express-mysql-session?label=%E2%98%85
711
+
712
+ [![★][express-nedb-session-image] express-nedb-session][express-nedb-session-url] A NeDB-based session store.
713
+
714
+ [express-nedb-session-url]: https://www.npmjs.com/package/express-nedb-session
715
+ [express-nedb-session-image]: https://badgen.net/github/stars/louischatriot/express-nedb-session?label=%E2%98%85
716
+
717
+ [![★][express-oracle-session-image] express-oracle-session][express-oracle-session-url] A session store using native
718
+ [oracle](https://www.oracle.com/) via the [node-oracledb](https://www.npmjs.com/package/oracledb) module.
719
+
720
+ [express-oracle-session-url]: https://www.npmjs.com/package/express-oracle-session
721
+ [express-oracle-session-image]: https://badgen.net/github/stars/slumber86/express-oracle-session?label=%E2%98%85
722
+
723
+ [![★][express-session-cache-manager-image] express-session-cache-manager][express-session-cache-manager-url]
724
+ A store that implements [cache-manager](https://www.npmjs.com/package/cache-manager), which supports
725
+ a [variety of storage types](https://www.npmjs.com/package/cache-manager#store-engines).
726
+
727
+ [express-session-cache-manager-url]: https://www.npmjs.com/package/express-session-cache-manager
728
+ [express-session-cache-manager-image]: https://badgen.net/github/stars/theogravity/express-session-cache-manager?label=%E2%98%85
729
+
730
+ [![★][express-session-etcd3-image] express-session-etcd3][express-session-etcd3-url] An [etcd3](https://github.com/mixer/etcd3) based session store.
731
+
732
+ [express-session-etcd3-url]: https://www.npmjs.com/package/express-session-etcd3
733
+ [express-session-etcd3-image]: https://badgen.net/github/stars/willgm/express-session-etcd3?label=%E2%98%85
734
+
735
+ [![★][express-session-level-image] express-session-level][express-session-level-url] A [LevelDB](https://github.com/Level/levelup) based session store.
736
+
737
+ [express-session-level-url]: https://www.npmjs.com/package/express-session-level
738
+ [express-session-level-image]: https://badgen.net/github/stars/tgohn/express-session-level?label=%E2%98%85
739
+
740
+ [![★][express-session-rsdb-image] express-session-rsdb][express-session-rsdb-url] Session store based on Rocket-Store: A very simple, super fast and yet powerfull, flat file database.
741
+
742
+ [express-session-rsdb-url]: https://www.npmjs.com/package/express-session-rsdb
743
+ [express-session-rsdb-image]: https://badgen.net/github/stars/paragi/express-session-rsdb?label=%E2%98%85
744
+
745
+ [![★][express-sessions-image] express-sessions][express-sessions-url] A session store supporting both MongoDB and Redis.
746
+
747
+ [express-sessions-url]: https://www.npmjs.com/package/express-sessions
748
+ [express-sessions-image]: https://badgen.net/github/stars/konteck/express-sessions?label=%E2%98%85
749
+
750
+ [![★][firestore-store-image] firestore-store][firestore-store-url] A [Firestore](https://github.com/hendrysadrak/firestore-store)-based session store.
751
+
752
+ [firestore-store-url]: https://www.npmjs.com/package/firestore-store
753
+ [firestore-store-image]: https://badgen.net/github/stars/hendrysadrak/firestore-store?label=%E2%98%85
754
+
755
+ [![★][fortune-session-image] fortune-session][fortune-session-url] A [Fortune.js](https://github.com/fortunejs/fortune)
756
+ based session store. Supports all backends supported by Fortune (MongoDB, Redis, Postgres, NeDB).
757
+
758
+ [fortune-session-url]: https://www.npmjs.com/package/fortune-session
759
+ [fortune-session-image]: https://badgen.net/github/stars/aliceklipper/fortune-session?label=%E2%98%85
760
+
761
+ [![★][hazelcast-store-image] hazelcast-store][hazelcast-store-url] A Hazelcast-based session store built on the [Hazelcast Node Client](https://www.npmjs.com/package/hazelcast-client).
762
+
763
+ [hazelcast-store-url]: https://www.npmjs.com/package/hazelcast-store
764
+ [hazelcast-store-image]: https://badgen.net/github/stars/jackspaniel/hazelcast-store?label=%E2%98%85
765
+
766
+ [![★][level-session-store-image] level-session-store][level-session-store-url] A LevelDB-based session store.
767
+
768
+ [level-session-store-url]: https://www.npmjs.com/package/level-session-store
769
+ [level-session-store-image]: https://badgen.net/github/stars/toddself/level-session-store?label=%E2%98%85
770
+
771
+ [![★][lowdb-session-store-image] lowdb-session-store][lowdb-session-store-url] A [lowdb](https://www.npmjs.com/package/lowdb)-based session store.
772
+
773
+ [lowdb-session-store-url]: https://www.npmjs.com/package/lowdb-session-store
774
+ [lowdb-session-store-image]: https://badgen.net/github/stars/fhellwig/lowdb-session-store?label=%E2%98%85
775
+
776
+ [![★][medea-session-store-image] medea-session-store][medea-session-store-url] A Medea-based session store.
777
+
778
+ [medea-session-store-url]: https://www.npmjs.com/package/medea-session-store
779
+ [medea-session-store-image]: https://badgen.net/github/stars/BenjaminVadant/medea-session-store?label=%E2%98%85
780
+
781
+ [![★][memorystore-image] memorystore][memorystore-url] A memory session store made for production.
782
+
783
+ [memorystore-url]: https://www.npmjs.com/package/memorystore
784
+ [memorystore-image]: https://badgen.net/github/stars/roccomuso/memorystore?label=%E2%98%85
785
+
786
+ [![★][mssql-session-store-image] mssql-session-store][mssql-session-store-url] A SQL Server-based session store.
787
+
788
+ [mssql-session-store-url]: https://www.npmjs.com/package/mssql-session-store
789
+ [mssql-session-store-image]: https://badgen.net/github/stars/jwathen/mssql-session-store?label=%E2%98%85
790
+
791
+ [![★][nedb-session-store-image] nedb-session-store][nedb-session-store-url] An alternate NeDB-based (either in-memory or file-persisted) session store.
792
+
793
+ [nedb-session-store-url]: https://www.npmjs.com/package/nedb-session-store
794
+ [nedb-session-store-image]: https://badgen.net/github/stars/JamesMGreene/nedb-session-store?label=%E2%98%85
795
+
796
+ [![★][@quixo3/prisma-session-store-image] @quixo3/prisma-session-store][@quixo3/prisma-session-store-url] A session store for the [Prisma Framework](https://www.prisma.io).
797
+
798
+ [@quixo3/prisma-session-store-url]: https://www.npmjs.com/package/@quixo3/prisma-session-store
799
+ [@quixo3/prisma-session-store-image]: https://badgen.net/github/stars/kleydon/prisma-session-store?label=%E2%98%85
800
+
801
+ [![★][restsession-image] restsession][restsession-url] Store sessions utilizing a RESTful API
802
+
803
+ [restsession-url]: https://www.npmjs.com/package/restsession
804
+ [restsession-image]: https://badgen.net/github/stars/jankal/restsession?label=%E2%98%85
805
+
806
+ [![★][sequelstore-connect-image] sequelstore-connect][sequelstore-connect-url] A session store using [Sequelize.js](http://sequelizejs.com/).
807
+
808
+ [sequelstore-connect-url]: https://www.npmjs.com/package/sequelstore-connect
809
+ [sequelstore-connect-image]: https://badgen.net/github/stars/MattMcFarland/sequelstore-connect?label=%E2%98%85
810
+
811
+ [![★][session-file-store-image] session-file-store][session-file-store-url] A file system-based session store.
812
+
813
+ [session-file-store-url]: https://www.npmjs.com/package/session-file-store
814
+ [session-file-store-image]: https://badgen.net/github/stars/valery-barysok/session-file-store?label=%E2%98%85
815
+
816
+ [![★][session-pouchdb-store-image] session-pouchdb-store][session-pouchdb-store-url] Session store for PouchDB / CouchDB. Accepts embedded, custom, or remote PouchDB instance and realtime synchronization.
817
+
818
+ [session-pouchdb-store-url]: https://www.npmjs.com/package/session-pouchdb-store
819
+ [session-pouchdb-store-image]: https://badgen.net/github/stars/solzimer/session-pouchdb-store?label=%E2%98%85
820
+
821
+ [![★][session-rethinkdb-image] session-rethinkdb][session-rethinkdb-url] A [RethinkDB](http://rethinkdb.com/)-based session store.
822
+
823
+ [session-rethinkdb-url]: https://www.npmjs.com/package/session-rethinkdb
824
+ [session-rethinkdb-image]: https://badgen.net/github/stars/llambda/session-rethinkdb?label=%E2%98%85
825
+
826
+ [![★][@databunker/session-store-image] @databunker/session-store][@databunker/session-store-url] A [Databunker](https://databunker.org/)-based encrypted session store.
827
+
828
+ [@databunker/session-store-url]: https://www.npmjs.com/package/@databunker/session-store
829
+ [@databunker/session-store-image]: https://badgen.net/github/stars/securitybunker/databunker-session-store?label=%E2%98%85
830
+
831
+ [![★][sessionstore-image] sessionstore][sessionstore-url] A session store that works with various databases.
832
+
833
+ [sessionstore-url]: https://www.npmjs.com/package/sessionstore
834
+ [sessionstore-image]: https://badgen.net/github/stars/adrai/sessionstore?label=%E2%98%85
835
+
836
+ [![★][tch-nedb-session-image] tch-nedb-session][tch-nedb-session-url] A file system session store based on NeDB.
837
+
838
+ [tch-nedb-session-url]: https://www.npmjs.com/package/tch-nedb-session
839
+ [tch-nedb-session-image]: https://badgen.net/github/stars/tomaschyly/NeDBSession?label=%E2%98%85
840
+
841
+ ## Examples
842
+
843
+ ### View counter
844
+
845
+ A simple example using `express-session` to store page views for a user.
846
+
847
+ ```js
848
+ var express = require('express')
849
+ var parseurl = require('parseurl')
850
+ var session = require('express-session')
851
+
852
+ var app = express()
853
+
854
+ app.use(session({
855
+ secret: 'keyboard cat',
856
+ resave: false,
857
+ saveUninitialized: true
858
+ }))
859
+
860
+ app.use(function (req, res, next) {
861
+ if (!req.session.views) {
862
+ req.session.views = {}
863
+ }
864
+
865
+ // get the url pathname
866
+ var pathname = parseurl(req).pathname
867
+
868
+ // count the views
869
+ req.session.views[pathname] = (req.session.views[pathname] || 0) + 1
870
+
871
+ next()
872
+ })
873
+
874
+ app.get('/foo', function (req, res, next) {
875
+ res.send('you viewed this page ' + req.session.views['/foo'] + ' times')
876
+ })
877
+
878
+ app.get('/bar', function (req, res, next) {
879
+ res.send('you viewed this page ' + req.session.views['/bar'] + ' times')
880
+ })
881
+
882
+ app.listen(3000)
883
+ ```
884
+
885
+ ### User login
886
+
887
+ A simple example using `express-session` to keep a user log in session.
888
+
889
+ ```js
890
+ var escapeHtml = require('escape-html')
891
+ var express = require('express')
892
+ var session = require('express-session')
893
+
894
+ var app = express()
895
+
896
+ app.use(session({
897
+ secret: 'keyboard cat',
898
+ resave: false,
899
+ saveUninitialized: true
900
+ }))
901
+
902
+ // middleware to test if authenticated
903
+ function isAuthenticated (req, res, next) {
904
+ if (req.session.user) next()
905
+ else next('route')
906
+ }
907
+
908
+ app.get('/', isAuthenticated, function (req, res) {
909
+ // this is only called when there is an authentication user due to isAuthenticated
910
+ res.send('hello, ' + escapeHtml(req.session.user) + '!' +
911
+ ' <a href="/logout">Logout</a>')
912
+ })
913
+
914
+ app.get('/', function (req, res) {
915
+ res.send('<form action="/login" method="post">' +
916
+ 'Username: <input name="user"><br>' +
917
+ 'Password: <input name="pass" type="password"><br>' +
918
+ '<input type="submit" text="Login"></form>')
919
+ })
920
+
921
+ app.post('/login', express.urlencoded({ extended: false }), function (req, res) {
922
+ // login logic to validate req.body.user and req.body.pass
923
+ // would be implemented here. for this example any combo works
924
+
925
+ // regenerate the session, which is good practice to help
926
+ // guard against forms of session fixation
927
+ req.session.regenerate(function (err) {
928
+ if (err) next(err)
929
+
930
+ // store user information in session, typically a user id
931
+ req.session.user = req.body.user
932
+
933
+ // save the session before redirection to ensure page
934
+ // load does not happen before session is saved
935
+ req.session.save(function (err) {
936
+ if (err) return next(err)
937
+ res.redirect('/')
938
+ })
939
+ })
940
+ })
941
+
942
+ app.get('/logout', function (req, res, next) {
943
+ // logout logic
944
+
945
+ // clear the user from the session object and save.
946
+ // this will ensure that re-using the old session id
947
+ // does not have a logged in user
948
+ req.session.user = null
949
+ req.session.save(function (err) {
950
+ if (err) next(err)
951
+
952
+ // regenerate the session, which is good practice to help
953
+ // guard against forms of session fixation
954
+ req.session.regenerate(function (err) {
955
+ if (err) next(err)
956
+ res.redirect('/')
957
+ })
958
+ })
959
+ })
960
+
961
+ app.listen(3000)
962
+ ```
963
+
964
+ ## Debugging
965
+
966
+ This module uses the [debug](https://www.npmjs.com/package/debug) module
967
+ internally to log information about session operations.
968
+
969
+ To see all the internal logs, set the `DEBUG` environment variable to
970
+ `express-session` when launching your app (`npm start`, in this example):
971
+
972
+ ```sh
973
+ $ DEBUG=express-session npm start
974
+ ```
975
+
976
+ On Windows, use the corresponding command;
977
+
978
+ ```sh
979
+ > set DEBUG=express-session & npm start
980
+ ```
981
+
982
+ ## License
983
+
984
+ [MIT](LICENSE)
985
+
986
+ [rfc-6265bis-03-4.1.2.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
987
+ [ci-image]: https://badgen.net/github/checks/expressjs/session/master?label=ci
988
+ [ci-url]: https://github.com/expressjs/session/actions?query=workflow%3Aci
989
+ [coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/session/master
990
+ [coveralls-url]: https://coveralls.io/r/expressjs/session?branch=master
991
+ [node-url]: https://nodejs.org/en/download
992
+ [npm-downloads-image]: https://badgen.net/npm/dm/express-session
993
+ [npm-url]: https://npmjs.org/package/express-session
994
+ [npm-version-image]: https://badgen.net/npm/v/express-session