set expiryDate for session (#50)

This commit is contained in:
Philip H 2023-12-03 10:50:11 +01:00 committed by GitHub
commit c73e64c9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ module.exports = class Server {
constructor() {
// Express
const expiryDate = new Date(Date.now() + 60 * 60 * 1000); // 1 hour
this.app = express()
.disable('etag')
.use('/', express.static(path.join(__dirname, '..', 'www')))
@ -33,6 +34,7 @@ module.exports = class Server {
saveUninitialized: true,
cookie: {
httpOnly: true,
expires: expiryDate,
},
}))