mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:30:56 +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
|
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)
|
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")
|
fmt.Fprintf(&b, "; Max-Age=0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user