mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	fix dns relay and samesite lax
This commit is contained in:
		
							parent
							
								
									57e77baed1
								
							
						
					
					
						commit
						e72614296c
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -5747,9 +5747,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
 | 
				
			||||||
        var sessionOptions = {
 | 
					        var sessionOptions = {
 | 
				
			||||||
            name: 'xid', // Recommended security practice to not use the default cookie name
 | 
					            name: 'xid', // Recommended security practice to not use the default cookie name
 | 
				
			||||||
            httpOnly: true,
 | 
					            httpOnly: true,
 | 
				
			||||||
 | 
					            domain: (certificates.CommonName != 'un-configured' ? "." + certificates.CommonName : null),
 | 
				
			||||||
            keys: [obj.args.sessionkey], // If multiple instances of this server are behind a load-balancer, this secret must be the same for all instances
 | 
					            keys: [obj.args.sessionkey], // If multiple instances of this server are behind a load-balancer, this secret must be the same for all instances
 | 
				
			||||||
            secure: (obj.args.tlsoffload == null), // Use this cookie only over TLS (Check this: https://expressjs.com/en/guide/behind-proxies.html)
 | 
					            secure: (obj.args.tlsoffload == null), // Use this cookie only over TLS (Check this: https://expressjs.com/en/guide/behind-proxies.html)
 | 
				
			||||||
            sameSite: obj.args.sessionsamesite
 | 
					            sameSite: (obj.args.sessionsamesite ? obj.args.sessionsamesite : 'lax')
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (obj.args.sessiontime != null) { sessionOptions.maxAge = (obj.args.sessiontime * 60 * 1000); }
 | 
					        if (obj.args.sessiontime != null) { sessionOptions.maxAge = (obj.args.sessiontime * 60 * 1000); }
 | 
				
			||||||
        obj.app.use(obj.session(sessionOptions));
 | 
					        obj.app.use(obj.session(sessionOptions));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue