mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:10:54 +00:00
commit
01c3812520
@ -146,18 +146,12 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
|
|||||||
}
|
}
|
||||||
|
|
||||||
// default false. for session cookie default true
|
// default false. for session cookie default true
|
||||||
httponly := false
|
|
||||||
if len(others) > 4 {
|
if len(others) > 4 {
|
||||||
if v, ok := others[4].(bool); ok && v {
|
if v, ok := others[4].(bool); ok && v {
|
||||||
// HttpOnly = true
|
fmt.Fprintf(&b, "; HttpOnly")
|
||||||
httponly = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if httponly {
|
|
||||||
fmt.Fprintf(&b, "; HttpOnly")
|
|
||||||
}
|
|
||||||
|
|
||||||
output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String())
|
output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user