mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 13:11:29 +00:00
Update session.go
remove = in if statement
This commit is contained in:
parent
a5124a1d45
commit
5e1e618d0f
@ -149,8 +149,9 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
|
||||
HttpOnly: true,
|
||||
Secure: manager.config.Secure,
|
||||
Domain: manager.config.Domain}
|
||||
if manager.config.CookieLifeTime >= 0 {
|
||||
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)
|
||||
@ -175,7 +176,7 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
|
||||
HttpOnly: true,
|
||||
Secure: manager.config.Secure,
|
||||
Domain: manager.config.Domain}
|
||||
if manager.config.CookieLifeTime >= 0 {
|
||||
if manager.config.CookieLifeTime > 0 {
|
||||
cookie.MaxAge = manager.config.CookieLifeTime
|
||||
cookie.Expires = time.Now().Add(time.Duration(manager.config.CookieLifeTime) * time.Second)
|
||||
}
|
||||
@ -242,7 +243,7 @@ func (manager *Manager) SessionRegenerateId(w http.ResponseWriter, r *http.Reque
|
||||
cookie.HttpOnly = true
|
||||
cookie.Path = "/"
|
||||
}
|
||||
if manager.config.CookieLifeTime >= 0 {
|
||||
if manager.config.CookieLifeTime > 0 {
|
||||
cookie.MaxAge = manager.config.CookieLifeTime
|
||||
cookie.Expires = time.Now().Add(time.Duration(manager.config.CookieLifeTime) * time.Second)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user