MCPcopy Index your code
hub / github.com/dnote/dnote / setSessionCookie

Function setSessionCookie

pkg/server/controllers/helpers.go:161–170  ·  view source on GitHub ↗
(w http.ResponseWriter, key string, expires time.Time)

Source from the content-addressed store, hash-verified

159)
160
161func setSessionCookie(w http.ResponseWriter, key string, expires time.Time) {
162 cookie := http.Cookie{
163 Name: sessionCookieName,
164 Value: key,
165 Expires: expires,
166 Path: sessionCookiePath,
167 HttpOnly: true,
168 }
169 http.SetCookie(w, &cookie)
170}
171
172func unsetSessionCookie(w http.ResponseWriter) {
173 expires := time.Now().Add(time.Hour * -24 * 30)

Callers 3

respondWithSessionFunction · 0.85
CreateMethod · 0.85
LoginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected