providers/session: Fix session cookie, make it more secure
This commit is contained in:
parent
2d5dbc50b3
commit
b9d55ad0b6
@ -108,11 +108,16 @@ func (this *state) funcSessionHTTP (
|
|||||||
result = session
|
result = session
|
||||||
}
|
}
|
||||||
cookie := &http.Cookie {
|
cookie := &http.Cookie {
|
||||||
Name: sessionIDCookieName,
|
Name: sessionIDCookieName,
|
||||||
Value: result.ID().String(),
|
Value: result.ID().String(),
|
||||||
Expires: expiration,
|
Expires: expiration,
|
||||||
|
Secure: true,
|
||||||
|
HttpOnly: true,
|
||||||
|
SameSite: http.SameSiteStrictMode,
|
||||||
|
Path: "/",
|
||||||
}
|
}
|
||||||
http.SetCookie(shttp.UnderlyingResponseWriter(res), cookie)
|
underlyingRes := shttp.UnderlyingResponseWriter(res)
|
||||||
|
http.SetCookie(underlyingRes, cookie)
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user