Skip to content

Commit

Permalink
Node - implement rolling / resaving sessions
Browse files Browse the repository at this point in the history
- Add true values to the rolling and resave options on the redis session to continually refresh the users session cookie and server's session entry with each request to the server
  • Loading branch information
wforbes committed Jan 14, 2022
1 parent c525bf4 commit d526c36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ app.use(session({
secure: false,
httpOnly: true, //means that javascript on browser can't access
maxAge: 60000 * 30 // 30 mins
}
},
rolling: true,
resave: true
}))

app.get("/api/v1", (req, res) => {
Expand Down

0 comments on commit d526c36

Please sign in to comment.