mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-30 06:45:47 -04:00
Merge pull request #428 from dalcde/cookies
This commit is contained in:
commit
244a5a937e
5 changed files with 35 additions and 14 deletions
|
@ -63,8 +63,15 @@ if (config.useSSL) {
|
|||
server = http.createServer(app)
|
||||
}
|
||||
|
||||
// if we manage to provide HTTPS domains, but don't provide TLS ourselves
|
||||
// obviously a proxy is involded. In order to make sure express is aware of
|
||||
// this, we provide the option to trust proxies here.
|
||||
if (!config.useSSL && config.protocolUseSSL) {
|
||||
app.set('trust proxy', 1)
|
||||
}
|
||||
|
||||
// socket io
|
||||
const io = SocketIO(server)
|
||||
const io = SocketIO(server, { cookie: false })
|
||||
io.engine.ws = new WebSocket.Server({
|
||||
noServer: true,
|
||||
perMessageDeflate: false
|
||||
|
@ -181,7 +188,9 @@ app.use(session({
|
|||
saveUninitialized: true, // always create session to ensure the origin
|
||||
rolling: true, // reset maxAge on every response
|
||||
cookie: {
|
||||
maxAge: config.sessionLife
|
||||
maxAge: config.sessionLife,
|
||||
sameSite: 'lax',
|
||||
secure: config.useSSL || config.protocolUseSSL || false
|
||||
},
|
||||
store: sessionStore
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue