Skip to content

Commit 4ee32ab

Browse files
committed
fix: csrf token
1 parent 267e291 commit 4ee32ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

csrf/csrf.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type key int
1616
const tokenKey = key(1)
1717
const signerKey = key(2)
1818

19-
const CookiesName = "x-csrf-token"
19+
const CookiesName = "x-csrf-token-2"
2020
const FormName = "x-csrf-token"
2121

2222
func GetToken(r *http.Request) string {
@@ -95,6 +95,7 @@ func Clear(w http.ResponseWriter) {
9595
Path: "/",
9696
Secure: true,
9797
HttpOnly: true,
98+
MaxAge: int(time.Hour/time.Second) * 24 * 7,
9899
})
99100
}
100101

0 commit comments

Comments
 (0)