Skip to content

Commit b1ee74e

Browse files
committed
docs: expand session.save() documentation
closes #208
1 parent c34a3f3 commit b1ee74e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ req.session.reload(function(err) {
268268

269269
#### Session.save()
270270

271+
Save the session back to the store, replacing the contents on the store with the
272+
contents in memory (though a store may do something else--consult the store's
273+
documentation for exact behavior).
274+
275+
This method is automatically called at the end of the HTTP response if the
276+
session data has been altered (though this behavior can be altered with various
277+
options in the middleware constructor). Because of this, typically this method
278+
does not need to be called.
279+
280+
There are some cases where it is useful to call this method, for example, long-
281+
lived requests or in WebSockets.
282+
271283
```js
272284
req.session.save(function(err) {
273285
// session saved

0 commit comments

Comments
 (0)