mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 15:40:55 +00:00
delete MaxAge cookielifeTime replace
This commit is contained in:
parent
828235b4c1
commit
b405e19f56
@ -56,11 +56,10 @@ type managerConfig struct {
|
|||||||
EnableSetCookie bool `json:"enableSetCookie,omitempty"`
|
EnableSetCookie bool `json:"enableSetCookie,omitempty"`
|
||||||
Gclifetime int64 `json:"gclifetime"`
|
Gclifetime int64 `json:"gclifetime"`
|
||||||
Maxlifetime int64 `json:"maxLifetime"`
|
Maxlifetime int64 `json:"maxLifetime"`
|
||||||
Maxage int `json:"maxage"`
|
|
||||||
Secure bool `json:"secure"`
|
Secure bool `json:"secure"`
|
||||||
SessionIDHashFunc string `json:"sessionIDHashFunc"`
|
SessionIDHashFunc string `json:"sessionIDHashFunc"`
|
||||||
SessionIDHashKey string `json:"sessionIDHashKey"`
|
SessionIDHashKey string `json:"sessionIDHashKey"`
|
||||||
CookieLifeTime int64 `json:"cookieLifeTime"`
|
CookieLifeTime int `json:"cookieLifeTime"`
|
||||||
ProviderConfig string `json:"providerConfig"`
|
ProviderConfig string `json:"providerConfig"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +124,8 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
|
|||||||
Path: "/",
|
Path: "/",
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
Secure: manager.config.Secure}
|
Secure: manager.config.Secure}
|
||||||
if manager.config.Maxage >= 0 {
|
if manager.config.CookieLifeTime >= 0 {
|
||||||
cookie.MaxAge = manager.config.Maxage
|
cookie.MaxAge = manager.config.CookieLifeTime
|
||||||
}
|
}
|
||||||
if manager.config.EnableSetCookie {
|
if manager.config.EnableSetCookie {
|
||||||
http.SetCookie(w, cookie)
|
http.SetCookie(w, cookie)
|
||||||
@ -144,8 +143,8 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
|
|||||||
Path: "/",
|
Path: "/",
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
Secure: manager.config.Secure}
|
Secure: manager.config.Secure}
|
||||||
if manager.config.Maxage >= 0 {
|
if manager.config.CookieLifeTime >= 0 {
|
||||||
cookie.MaxAge = manager.config.Maxage
|
cookie.MaxAge = manager.config.CookieLifeTime
|
||||||
}
|
}
|
||||||
if manager.config.EnableSetCookie {
|
if manager.config.EnableSetCookie {
|
||||||
http.SetCookie(w, cookie)
|
http.SetCookie(w, cookie)
|
||||||
@ -206,8 +205,8 @@ func (manager *Manager) SessionRegenerateId(w http.ResponseWriter, r *http.Reque
|
|||||||
cookie.HttpOnly = true
|
cookie.HttpOnly = true
|
||||||
cookie.Path = "/"
|
cookie.Path = "/"
|
||||||
}
|
}
|
||||||
if manager.config.Maxage >= 0 {
|
if manager.config.CookieLifeTime >= 0 {
|
||||||
cookie.MaxAge = manager.config.Maxage
|
cookie.MaxAge = manager.config.CookieLifeTime
|
||||||
}
|
}
|
||||||
http.SetCookie(w, cookie)
|
http.SetCookie(w, cookie)
|
||||||
r.AddCookie(cookie)
|
r.AddCookie(cookie)
|
||||||
|
Loading…
Reference in New Issue
Block a user