1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 03:00:19 +00:00

update sessionRelease

1. mysql fix last access time not update
2. mysql & redid Release when data is empty
3. add maxlifetime distinct Gclifetime
This commit is contained in:
astaxie
2014-01-08 20:54:20 +08:00
parent b766f65c26
commit aa2fef0d36
4 changed files with 19 additions and 22 deletions

View File

@ -52,6 +52,7 @@ type managerConfig struct {
CookieName string `json:"cookieName"`
EnableSetCookie bool `json:"enableSetCookie,omitempty"`
Gclifetime int64 `json:"gclifetime"`
Maxlifetime int64 `json:"maxLifetime"`
Maxage int `json:"maxage"`
Secure bool `json:"secure"`
SessionIDHashFunc string `json:"sessionIDHashFunc"`
@ -81,7 +82,11 @@ func NewManager(provideName, config string) (*Manager, error) {
if err != nil {
return nil, err
}
provider.SessionInit(cf.Gclifetime, cf.ProviderConfig)
if cf.Maxlifetime == 0 {
cf.Maxlifetime = cf.Gclifetime
}
provider.SessionInit(cf.Maxlifetime, cf.ProviderConfig)
if cf.SessionIDHashFunc == "" {
cf.SessionIDHashFunc = "sha1"