1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 14:50:49 +00:00

Update session.go

move expire in line 154 to 247, because it will cause session_cookie not writen to explorer
This commit is contained in:
Yongzheng Lai 2015-04-03 17:41:09 +08:00 committed by astaxie
parent 1148359570
commit fd610d6777

View File

@ -151,7 +151,6 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
Domain: manager.config.Domain}
if manager.config.CookieLifeTime >= 0 {
cookie.MaxAge = manager.config.CookieLifeTime
cookie.Expires = time.Now().Add(time.Duration(manager.config.CookieLifeTime) * time.Second)
}
if manager.config.EnableSetCookie {
http.SetCookie(w, cookie)
@ -245,6 +244,7 @@ func (manager *Manager) SessionRegenerateId(w http.ResponseWriter, r *http.Reque
}
if manager.config.CookieLifeTime >= 0 {
cookie.MaxAge = manager.config.CookieLifeTime
cookie.Expires = time.Now().Add(time.Duration(manager.config.CookieLifeTime) * time.Second)
}
http.SetCookie(w, cookie)
r.AddCookie(cookie)