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

Method MaxAge

store.go:249–258  ·  view source on GitHub ↗

MaxAge sets the maximum age for the store and the underlying cookie implementation. Individual sessions can be deleted by setting Options.MaxAge = -1 for that session.

(age int)

Source from the content-addressed store, hash-verified

247// implementation. Individual sessions can be deleted by setting Options.MaxAge
248// = -1 for that session.
249func (s *FilesystemStore) MaxAge(age int) {
250 s.Options.MaxAge = age
251
252 // Set the maxAge for each securecookie instance.
253 for _, codec := range s.Codecs {
254 if sc, ok := codec.(*securecookie.SecureCookie); ok {
255 sc.MaxAge(age)
256 }
257 }
258}
259
260// save writes encoded session.Values to a file.
261func (s *FilesystemStore) save(session *Session) error {

Callers 1

NewFilesystemStoreFunction · 0.95

Calls 1

MaxAgeMethod · 0.45

Tested by

no test coverage detected