Added SetCookie method to cookies package

This commit is contained in:
2025-02-16 12:30:19 +11:00
parent fa64b05415
commit cb6f4184f8
3 changed files with 38 additions and 20 deletions

View File

@@ -32,6 +32,5 @@ func SetPageFrom(w http.ResponseWriter, r *http.Request, trustedHost string) {
} else {
pageFrom = parsedURL.Path
}
pageFromCookie := &http.Cookie{Name: "pagefrom", Value: pageFrom, Path: "/"}
http.SetCookie(w, pageFromCookie)
SetCookie(w, "pagefrom", "/", pageFrom, 0)
}