mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-21 20:29:20 +02:00
Use stricter cookie attributes
This commit is contained in:
parent
b83a00aa2c
commit
d297eb5658
|
@ -34,6 +34,8 @@ func (c *client) setSession(sess *model.Session) error {
|
|||
}
|
||||
http.SetCookie(c.w, &http.Cookie{
|
||||
Name: "session",
|
||||
Path: "/",
|
||||
HttpOnly: true,
|
||||
Value: sb.String(),
|
||||
Expires: time.Now().Add(365 * 24 * time.Hour),
|
||||
})
|
||||
|
@ -53,6 +55,7 @@ func (c *client) getSession() (sess *model.Session, err error) {
|
|||
func (c *client) unsetSession() {
|
||||
http.SetCookie(c.w, &http.Cookie{
|
||||
Name: "session",
|
||||
Path: "/",
|
||||
Value: "",
|
||||
Expires: time.Now(),
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue