mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 07:50:54 +00:00
Merge pull request #1709 from mlgd/develop
Fix cookies in accordance with the "net / http" and Flash usage
This commit is contained in:
commit
5698b5dc92
@ -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