Commit fd610d67 authored by Yongzheng Lai's avatar Yongzheng Lai Committed by astaxie

Update session.go

move expire in line 154 to 247, because it will cause session_cookie not writen to explorer
parent 11483595
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment