Add rolling option on session to reset maxAge on every response to extend session life
This commit is contained in:
		
							parent
							
								
									3c7d39c52d
								
							
						
					
					
						commit
						f7a4f8f8c2
					
				
							
								
								
									
										3
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								app.js
									
									
									
									
									
								
							| @ -100,9 +100,10 @@ app.use(session({ | ||||
|     secret: config.sessionsecret, | ||||
|     resave: false, //don't save session if unmodified
 | ||||
|     saveUninitialized: true, //always create session to ensure the origin
 | ||||
|     rolling: true, // reset maxAge on every response
 | ||||
|     cookie: { | ||||
|         maxAge: config.sessionlife, | ||||
|         expires: new Date(Date.now() + config.sessionlife), | ||||
|         expires: new Date(Date.now() + config.sessionlife) | ||||
|     }, | ||||
|     store: sessionStore | ||||
| })); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user