session will be expire in 1 hour

This commit is contained in:
Philip H. 2023-12-03 09:06:06 +00:00 committed by GitHub
parent 35144b34c2
commit 7d755f033b
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,
},
}))