fix dns relay and samesite lax

Simon Smith committed Jul 7, 2022 at 14:57 UTC e72614296c64f2f0f924b550a3b747eb2ee01bd3
1 file changed +2 -1
webserver.js
+2 -1
@@ -5747,9 +5747,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
5747 var sessionOptions = {
5748 name: 'xid', // Recommended security practice to not use the default cookie name
5749 httpOnly: true,
5750 + domain: (certificates.CommonName != 'un-configured' ? "." + certificates.CommonName : null),
5751 keys: [obj.args.sessionkey], // If multiple instances of this server are behind a load-balancer, this secret must be the same for all instances
5752 secure: (obj.args.tlsoffload == null), // Use this cookie only over TLS (Check this: https://expressjs.com/en/guide/behind-proxies.html)
5752 - sameSite: obj.args.sessionsamesite
5753 + sameSite: (obj.args.sessionsamesite ? obj.args.sessionsamesite : 'lax')
5754 }
5755 if (obj.args.sessiontime != null) { sessionOptions.maxAge = (obj.args.sessiontime * 60 * 1000); }
5756 obj.app.use(obj.session(sessionOptions));