simple the session init
Showing
3 changed files
with
0 additions
and
16 deletions
| ... | @@ -113,8 +113,6 @@ func listConf(rw http.ResponseWriter, r *http.Request) { | ... | @@ -113,8 +113,6 @@ func listConf(rw http.ResponseWriter, r *http.Request) { |
| 113 | m["SessionName"] = SessionName | 113 | m["SessionName"] = SessionName |
| 114 | m["SessionGCMaxLifetime"] = SessionGCMaxLifetime | 114 | m["SessionGCMaxLifetime"] = SessionGCMaxLifetime |
| 115 | m["SessionSavePath"] = SessionSavePath | 115 | m["SessionSavePath"] = SessionSavePath |
| 116 | m["SessionHashFunc"] = SessionHashFunc | ||
| 117 | m["SessionHashKey"] = SessionHashKey | ||
| 118 | m["SessionCookieLifeTime"] = SessionCookieLifeTime | 116 | m["SessionCookieLifeTime"] = SessionCookieLifeTime |
| 119 | m["UseFcgi"] = UseFcgi | 117 | m["UseFcgi"] = UseFcgi |
| 120 | m["MaxMemory"] = MaxMemory | 118 | m["MaxMemory"] = MaxMemory | ... | ... |
| ... | @@ -383,8 +383,6 @@ func initBeforeHttpRun() { | ... | @@ -383,8 +383,6 @@ func initBeforeHttpRun() { |
| 383 | `"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` + | 383 | `"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` + |
| 384 | `"providerConfig":"` + filepath.ToSlash(SessionSavePath) + `",` + | 384 | `"providerConfig":"` + filepath.ToSlash(SessionSavePath) + `",` + |
| 385 | `"secure":` + strconv.FormatBool(EnableHttpTLS) + `,` + | 385 | `"secure":` + strconv.FormatBool(EnableHttpTLS) + `,` + |
| 386 | `"sessionIDHashFunc":"` + SessionHashFunc + `",` + | ||
| 387 | `"sessionIDHashKey":"` + SessionHashKey + `",` + | ||
| 388 | `"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` + | 386 | `"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` + |
| 389 | `"domain":"` + SessionDomain + `",` + | 387 | `"domain":"` + SessionDomain + `",` + |
| 390 | `"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `}` | 388 | `"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `}` | ... | ... |
| ... | @@ -56,8 +56,6 @@ var ( | ... | @@ -56,8 +56,6 @@ var ( |
| 56 | SessionName string // the cookie name when saving session id into cookie. | 56 | SessionName string // the cookie name when saving session id into cookie. |
| 57 | SessionGCMaxLifetime int64 // session gc time for auto cleaning expired session. | 57 | SessionGCMaxLifetime int64 // session gc time for auto cleaning expired session. |
| 58 | SessionSavePath string // if use mysql/redis/file provider, define save path to connection info. | 58 | SessionSavePath string // if use mysql/redis/file provider, define save path to connection info. |
| 59 | SessionHashFunc string // session hash generation func. | ||
| 60 | SessionHashKey string // session hash salt string. | ||
| 61 | SessionCookieLifeTime int // the life time of session id in cookie. | 59 | SessionCookieLifeTime int // the life time of session id in cookie. |
| 62 | SessionAutoSetCookie bool // auto setcookie | 60 | SessionAutoSetCookie bool // auto setcookie |
| 63 | SessionDomain string // the cookie domain default is empty | 61 | SessionDomain string // the cookie domain default is empty |
| ... | @@ -237,8 +235,6 @@ func init() { | ... | @@ -237,8 +235,6 @@ func init() { |
| 237 | SessionName = "beegosessionID" | 235 | SessionName = "beegosessionID" |
| 238 | SessionGCMaxLifetime = 3600 | 236 | SessionGCMaxLifetime = 3600 |
| 239 | SessionSavePath = "" | 237 | SessionSavePath = "" |
| 240 | SessionHashFunc = "sha1" | ||
| 241 | SessionHashKey = "beegoserversessionkey" | ||
| 242 | SessionCookieLifeTime = 0 //set cookie default is the brower life | 238 | SessionCookieLifeTime = 0 //set cookie default is the brower life |
| 243 | SessionAutoSetCookie = true | 239 | SessionAutoSetCookie = true |
| 244 | 240 | ||
| ... | @@ -354,14 +350,6 @@ func ParseConfig() (err error) { | ... | @@ -354,14 +350,6 @@ func ParseConfig() (err error) { |
| 354 | SessionSavePath = sesssavepath | 350 | SessionSavePath = sesssavepath |
| 355 | } | 351 | } |
| 356 | 352 | ||
| 357 | if sesshashfunc := AppConfig.String("SessionHashFunc"); sesshashfunc != "" { | ||
| 358 | SessionHashFunc = sesshashfunc | ||
| 359 | } | ||
| 360 | |||
| 361 | if sesshashkey := AppConfig.String("SessionHashKey"); sesshashkey != "" { | ||
| 362 | SessionHashKey = sesshashkey | ||
| 363 | } | ||
| 364 | |||
| 365 | if sessMaxLifeTime, err := AppConfig.Int64("SessionGCMaxLifetime"); err == nil && sessMaxLifeTime != 0 { | 353 | if sessMaxLifeTime, err := AppConfig.Int64("SessionGCMaxLifetime"); err == nil && sessMaxLifeTime != 0 { |
| 366 | SessionGCMaxLifetime = sessMaxLifeTime | 354 | SessionGCMaxLifetime = sessMaxLifeTime |
| 367 | } | 355 | } | ... | ... |
-
Please register or sign in to post a comment