summaryrefslogtreecommitdiff
path: root/pkg/web/cookie/expire.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-07 08:46:32 -0700
committermo khan <mo@mokhan.ca>2025-05-07 08:46:32 -0700
commitf417e03cb09024743baf2f749e4309032afd5f39 (patch)
treec2449a35404af96a2395f8716a0901a80c63bf94 /pkg/web/cookie/expire.go
parentd3cb17f8032d95f0f8805a0ce74fe5fc41714bb8 (diff)
refactor: delegate to cookie package
Diffstat (limited to 'pkg/web/cookie/expire.go')
-rw-r--r--pkg/web/cookie/expire.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkg/web/cookie/expire.go b/pkg/web/cookie/expire.go
index b44fc38..7d90274 100644
--- a/pkg/web/cookie/expire.go
+++ b/pkg/web/cookie/expire.go
@@ -1,7 +1,17 @@
package cookie
-import "net/http"
+import (
+ "net/http"
+
+ "github.com/xlgmokha/x/pkg/cookie"
+ "github.com/xlgmokha/x/pkg/env"
+)
func Expire(w http.ResponseWriter, name string) {
- http.SetCookie(w, Reset(name))
+ cookie.Expire(w, name,
+ cookie.WithPath("/"),
+ cookie.WithDomain(env.Fetch("HOST", "localhost")),
+ cookie.WithHttpOnly(true),
+ cookie.WithSecure(true),
+ )
}