commit
						41633900da
					
				
							
								
								
									
										48
									
								
								config.go
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								config.go
									
									
									
									
									
								
							| @ -86,18 +86,18 @@ type WebConfig struct { | |||||||
| 
 | 
 | ||||||
| // SessionConfig holds session related config | // SessionConfig holds session related config | ||||||
| type SessionConfig struct { | type SessionConfig struct { | ||||||
| 	SessionOn               bool | 	SessionOn                    bool | ||||||
| 	SessionProvider         string | 	SessionProvider              string | ||||||
| 	SessionName             string | 	SessionName                  string | ||||||
| 	SessionGCMaxLifetime    int64 | 	SessionGCMaxLifetime         int64 | ||||||
| 	SessionProviderConfig   string | 	SessionProviderConfig        string | ||||||
| 	SessionCookieLifeTime   int | 	SessionCookieLifeTime        int | ||||||
| 	SessionAutoSetCookie    bool | 	SessionAutoSetCookie         bool | ||||||
| 	SessionDomain           string | 	SessionDomain                string | ||||||
| 	SessionDisableHTTPOnly  bool // used to allow for cross domain cookies/javascript cookies. | 	SessionDisableHTTPOnly       bool // used to allow for cross domain cookies/javascript cookies. | ||||||
| 	EnableSidInHttpHeader   bool //	enable store/get the sessionId into/from http headers | 	SessionEnableSidInHTTPHeader bool //	enable store/get the sessionId into/from http headers | ||||||
| 	SessionNameInHttpHeader string | 	SessionNameInHTTPHeader      string | ||||||
| 	EnableSidInUrlQuery     bool //	enable get the sessionId from Url Query params | 	SessionEnableSidInURLQuery   bool //	enable get the sessionId from Url Query params | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // LogConfig holds Log related config | // LogConfig holds Log related config | ||||||
| @ -222,18 +222,18 @@ func newBConfig() *Config { | |||||||
| 			XSRFKey:                "beegoxsrf", | 			XSRFKey:                "beegoxsrf", | ||||||
| 			XSRFExpire:             0, | 			XSRFExpire:             0, | ||||||
| 			Session: SessionConfig{ | 			Session: SessionConfig{ | ||||||
| 				SessionOn:               false, | 				SessionOn:                    false, | ||||||
| 				SessionProvider:         "memory", | 				SessionProvider:              "memory", | ||||||
| 				SessionName:             "beegosessionID", | 				SessionName:                  "beegosessionID", | ||||||
| 				SessionGCMaxLifetime:    3600, | 				SessionGCMaxLifetime:         3600, | ||||||
| 				SessionProviderConfig:   "", | 				SessionProviderConfig:        "", | ||||||
| 				SessionDisableHTTPOnly:  false, | 				SessionDisableHTTPOnly:       false, | ||||||
| 				SessionCookieLifeTime:   0, //set cookie default is the browser life | 				SessionCookieLifeTime:        0, //set cookie default is the browser life | ||||||
| 				SessionAutoSetCookie:    true, | 				SessionAutoSetCookie:         true, | ||||||
| 				SessionDomain:           "", | 				SessionDomain:                "", | ||||||
| 				EnableSidInHttpHeader:   false, //	enable store/get the sessionId into/from http headers | 				SessionEnableSidInHTTPHeader: false, //	enable store/get the sessionId into/from http headers | ||||||
| 				SessionNameInHttpHeader: "Beegosessionid", | 				SessionNameInHTTPHeader:      "Beegosessionid", | ||||||
| 				EnableSidInUrlQuery:     false, //	enable get the sessionId from Url Query params | 				SessionEnableSidInURLQuery:   false, //	enable get the sessionId from Url Query params | ||||||
| 			}, | 			}, | ||||||
| 		}, | 		}, | ||||||
| 		Log: LogConfig{ | 		Log: LogConfig{ | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								hooks.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								hooks.go
									
									
									
									
									
								
							| @ -55,9 +55,9 @@ func registerSession() error { | |||||||
| 			conf.ProviderConfig = filepath.ToSlash(BConfig.WebConfig.Session.SessionProviderConfig) | 			conf.ProviderConfig = filepath.ToSlash(BConfig.WebConfig.Session.SessionProviderConfig) | ||||||
| 			conf.DisableHTTPOnly = BConfig.WebConfig.Session.SessionDisableHTTPOnly | 			conf.DisableHTTPOnly = BConfig.WebConfig.Session.SessionDisableHTTPOnly | ||||||
| 			conf.Domain = BConfig.WebConfig.Session.SessionDomain | 			conf.Domain = BConfig.WebConfig.Session.SessionDomain | ||||||
| 			conf.EnableSidInHttpHeader = BConfig.WebConfig.Session.EnableSidInHttpHeader | 			conf.EnableSidInHttpHeader = BConfig.WebConfig.Session.SessionEnableSidInHTTPHeader | ||||||
| 			conf.SessionNameInHttpHeader = BConfig.WebConfig.Session.SessionNameInHttpHeader | 			conf.SessionNameInHttpHeader = BConfig.WebConfig.Session.SessionNameInHTTPHeader | ||||||
| 			conf.EnableSidInUrlQuery = BConfig.WebConfig.Session.EnableSidInUrlQuery | 			conf.EnableSidInUrlQuery = BConfig.WebConfig.Session.SessionEnableSidInURLQuery | ||||||
| 		} else { | 		} else { | ||||||
| 			if err = json.Unmarshal([]byte(sessionConfig), conf); err != nil { | 			if err = json.Unmarshal([]byte(sessionConfig), conf); err != nil { | ||||||
| 				return err | 				return err | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user