-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
363f9bd
commit 53b12f9
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package common | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
// previous cookie configuration in canary release of 2024/10 break existing cookie and | ||
// can introduce weird error when a user has things in cache. | ||
// this code will deprecate early 2025 | ||
func RecoverFromBadCookie(res http.ResponseWriter) { | ||
http.SetCookie(res, &http.Cookie{ | ||
Name: "auth", | ||
Value: "", | ||
MaxAge: -1, | ||
HttpOnly: true, | ||
SameSite: http.SameSiteStrictMode, | ||
Path: WithBase("/api/"), | ||
Secure: false, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters