package infra

import "net/http"

// SessionCookieClear invalidates the named session cookie by setting
// MaxAge=-1. The browser removes the cookie immediately on receipt.
// It does not return an error because http.SetCookie never fails at runtime.
func SessionCookieClear(w http.ResponseWriter, name string) {
	http.SetCookie(w, &http.Cookie{
		Name:     name,
		Value:    "",
		Path:     "/",
		HttpOnly: true,
		SameSite: http.SameSiteLaxMode,
		MaxAge:   -1,
	})
}
