summaryrefslogtreecommitdiff
path: root/store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store.go')
-rw-r--r--store.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/store.go b/store.go
index a5cb867..5b43bc8 100644
--- a/store.go
+++ b/store.go
@@ -16,6 +16,15 @@ import (
)
// Store is an interface for custom session stores.
+//
+// Get should return a cached session.
+// New should create and return a new session.
+// Save should persist session to the underlying store implementation.
+//
+// Note that New should never return a nul session, even in the case of an error
+// if using the Registry infrastructure for caching of sessions in your store.
+//
+// See CookieStore and FilesystemStore for examples.
type Store interface {
Get(r *http.Request, name string) (*Session, error)
New(r *http.Request, name string) (*Session, error)