summaryrefslogtreecommitdiff
path: root/vendor/github.com/gin-contrib/sessions/sessions.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gin-contrib/sessions/sessions.go')
-rw-r--r--vendor/github.com/gin-contrib/sessions/sessions.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/github.com/gin-contrib/sessions/sessions.go b/vendor/github.com/gin-contrib/sessions/sessions.go
index 8972e2321..fe116e8ef 100644
--- a/vendor/github.com/gin-contrib/sessions/sessions.go
+++ b/vendor/github.com/gin-contrib/sessions/sessions.go
@@ -22,6 +22,8 @@ type Store interface {
// Wraps thinly gorilla-session methods.
// Session stores the values and optional configuration for a session.
type Session interface {
+ // ID of the session, generated by stores. It should not be used for user data.
+ ID() string
// Get returns the session value associated to the given key.
Get(key interface{}) interface{}
// Set sets the session value associated to the given key.
@@ -74,6 +76,10 @@ type session struct {
writer http.ResponseWriter
}
+func (s *session) ID() string {
+ return s.Session().ID
+}
+
func (s *session) Get(key interface{}) interface{} {
return s.Session().Values[key]
}