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)
| 140 | // |
| 141 | // See NewCookieStore() for a description of the other parameters. |
| 142 | func 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 | // |
searching dependent graphs…