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

Function NewFilesystemStore

store.go:142–157  ·  view source on GitHub ↗

NewFilesystemStore returns a new FilesystemStore. The path argument is the directory where sessions will be saved. If empty it will use os.TempDir(). See NewCookieStore() for a description of the other parameters.

(path string, keyPairs ...[]byte)

Source from the content-addressed store, hash-verified

140//
141// See NewCookieStore() for a description of the other parameters.
142func NewFilesystemStore(path string, keyPairs ...[]byte) *FilesystemStore {
143 if path == "" {
144 path = os.TempDir()
145 }
146 fs := &FilesystemStore{
147 Codecs: securecookie.CodecsFromPairs(keyPairs...),
148 Options: &Options{
149 Path: "/",
150 MaxAge: 86400 * 30,
151 },
152 path: path,
153 }
154
155 fs.MaxAge(fs.Options.MaxAge)
156 return fs
157}
158
159// FilesystemStore stores sessions in the filesystem.
160//

Callers 4

TestGH8FilesystemStoreFunction · 0.85
TestGH2MaxLengthFunction · 0.85

Calls 1

MaxAgeMethod · 0.95

Tested by 4

TestGH8FilesystemStoreFunction · 0.68
TestGH2MaxLengthFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…