Skip to content

Commit

Permalink
Try a rolling session middleware (#1244)
Browse files Browse the repository at this point in the history
* Alternative is "Remember me" option although I think I'd rather have a "Forget me" option by default.

Post #1202 and related to #604

Auto-merge
  • Loading branch information
Martii authored Nov 9, 2017
1 parent a351adf commit 12e4b76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ app.use(function (aReq, aRes, aNext) {
aNext();
});
app.use(modifySessions.init(sessionStore));

// Rolling user session
app.use(function (aReq, aRes, aNext) {
if (aReq.session.user) {
aReq.session.user._touched = new Date();
}
aNext();
});

app.use(favicon(__dirname + '/public/images/favicon.ico'));

// Set up the views
Expand Down

0 comments on commit 12e4b76

Please sign in to comment.