Extended the session timeout to 6 hours.
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,4 +1,3 @@
 | 
				
			|||||||
build/
 | 
					build/
 | 
				
			||||||
*.sw?
 | 
					*.sw?
 | 
				
			||||||
*.beam
 | 
					 | 
				
			||||||
.sass-cache
 | 
					.sass-cache
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ new(Username) ->
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    Session = #ts_api_session{
 | 
					    Session = #ts_api_session{
 | 
				
			||||||
        username = Username,
 | 
					        username = Username,
 | 
				
			||||||
        expires = Seconds + 12*24*24
 | 
					        expires = Seconds + 60*60*6
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    CookieVal = yaws_api:new_cookie_session(Session),
 | 
					    CookieVal = yaws_api:new_cookie_session(Session),
 | 
				
			||||||
@@ -47,8 +47,8 @@ get_session(YArg) ->
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            % cookie is fresh
 | 
					            % cookie is fresh
 | 
				
			||||||
            true -> 
 | 
					            true -> 
 | 
				
			||||||
                % update the expiry time
 | 
					                % update the expiry time                         6 hours: sec min hr
 | 
				
			||||||
                NewSession = Session#ts_api_session{expires = NowSeconds + 12*24*24},
 | 
					                NewSession = Session#ts_api_session{expires = NowSeconds + 60*60* 6},
 | 
				
			||||||
                yaws_api:replace_cookie_session(CookieVal, NewSession),
 | 
					                yaws_api:replace_cookie_session(CookieVal, NewSession),
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                % return cookie
 | 
					                % return cookie
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user