MCPcopy
hub / github.com/gorilla/sessions / Save

Method Save

store.go:107–116  ·  view source on GitHub ↗

Save adds a single session to the response.

(r *http.Request, w http.ResponseWriter,
	session *Session)

Source from the content-addressed store, hash-verified

105
106// Save adds a single session to the response.
107func (s *CookieStore) Save(r *http.Request, w http.ResponseWriter,
108 session *Session) error {
109 encoded, err := securecookie.EncodeMulti(session.Name(), session.Values,
110 s.Codecs...)
111 if err != nil {
112 return err
113 }
114 http.SetCookie(w, NewCookie(session.Name(), encoded, session.Options))
115 return nil
116}
117
118// MaxAge sets the maximum age for the store and the underlying cookie
119// implementation. Individual sessions can be deleted by setting Options.MaxAge

Callers

nothing calls this directly

Calls 2

NewCookieFunction · 0.85
NameMethod · 0.80

Tested by

no test coverage detected