1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 05:40:54 +00:00
This commit is contained in:
astaxie 2013-10-29 22:03:06 +08:00
parent 5d54acba30
commit 0ddde6fa9f

View File

@ -133,12 +133,12 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
r.AddCookie(cookie)
} else {
//cookie.Expires = time.Now().Add(time.Duration(manager.maxlifetime) * time.Second)
cookie.HttpOnly = true
cookie.Path = "/"
if manager.maxage >= 0 {
cookie.MaxAge = manager.maxage
http.SetCookie(w, cookie)
}
//cookie.HttpOnly = true
//cookie.Path = "/"
//if manager.maxage >= 0 {
// cookie.MaxAge = manager.maxage
// http.SetCookie(w, cookie)
//}
sid, _ := url.QueryUnescape(cookie.Value)
session, _ = manager.provider.SessionRead(sid)
}