diff options
author | Kamil Kisiel <kamil@kamilkisiel.net> | 2013-10-17 20:55:59 +0400 |
---|---|---|
committer | Kamil Kisiel <kamil@kamilkisiel.net> | 2013-10-17 20:55:59 +0400 |
commit | 81f1be5cc016add5e0b8a19c3159fbff96e07829 (patch) | |
tree | da7003de4ca65359b0bc5208e7fa9ea5ac9fe980 /store.go | |
parent | 8593e03f3101a7001cd6c76a6fb0f3c5cbf2724c (diff) |
Add MaxLength to FilesystemStore.
Diffstat (limited to 'store.go')
-rw-r--r-- | store.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -137,6 +137,17 @@ type FilesystemStore struct { path string } +// MaxLength restricts the maximum length of new sessions to l. +// If l is 0 there is no limit to the size of a session, use with caution. +// The default for a new FilesystemStore is 4096. +func (s *FilesystemStore) MaxLength(l int) { + for _, c := range s.Codecs { + if codec, ok := c.(*securecookie.SecureCookie); ok { + codec.MaxLength(l) + } + } +} + // Get returns a session for the given name after adding it to the registry. // // See CookieStore.Get(). |