Documentation ¶
Index ¶
Constants ¶
View Source
const (
// CookieName is the name of the session cookie.
CookieName = "__Host-session"
)
Variables ¶
This section is empty.
Functions ¶
func ClearCookie ¶
func ClearCookie(w http.ResponseWriter)
ClearCookie wipes the session cookie to invalidate the user session.
func EncodeCookie ¶
EncodeCookie returns the string representation of a Cookie that should be used to store the user session in the cookies of a http.ResponseWriter.
func SetCookie ¶
func SetCookie(w http.ResponseWriter, user, sid string) error
SetCookie encodes the provided user and session id via EncodeCookie and then sets the http.Cookie of the provided http.ResponseWriter.
Types ¶
Click to show internal directories.
Click to hide internal directories.