mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:40:55 +00:00
Fix cookies in accordance with the "net / http" and Flash usage
Fixed issue of Flash cookies that are deleted before being read Max-age parameter conform to "net/http" Cookie
This commit is contained in:
parent
2b23764ee0
commit
9119f766d2
@ -97,9 +97,10 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
|
||||
maxAge = v
|
||||
}
|
||||
|
||||
if maxAge > 0 {
|
||||
switch {
|
||||
case maxAge > 0:
|
||||
fmt.Fprintf(&b, "; Expires=%s; Max-Age=%d", time.Now().Add(time.Duration(maxAge)*time.Second).UTC().Format(time.RFC1123), maxAge)
|
||||
} else {
|
||||
case maxAge < 0:
|
||||
fmt.Fprintf(&b, "; Max-Age=0")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user