Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion code/plugins/webgui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ const KnexSessionStore = require('connect-session-knex')(session);
const store = new KnexSessionStore({ knex });
const sessionParser = session({
secret: '5E14cd8749A',
name: 'customSessionId', // Custom session cookie name
resave: false,
saveUninitialized: true,
cookie: { secure: false, httpOnly: true, maxAge: 5 * 24 * 60 * 60 * 1000 },
cookie: {
secure: true, // Ensure cookies are only sent over HTTPS
httpOnly: true,
maxAge: 5 * 24 * 60 * 60 * 1000,
domain: 'example.com', // Set the domain for the cookie
path: '/', // Set the path for the cookie
expires: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000) // Set expiration date
},
store,
});
const bodyParser = require('body-parser');
Expand Down