summaryrefslogtreecommitdiff
path: root/vendor/github.com/gin-contrib/sessions/sessions.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-11-27 15:26:58 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-27 15:26:58 +0100
commit182b4eea73881c611a0f519576aa6ad2aa6799c2 (patch)
tree230fac469690fcee8797b13585e739be148d4789 /vendor/github.com/gin-contrib/sessions/sessions.go
parentRequire confirmed email when checking oauth token (#332) (diff)
downloadgotosocial-182b4eea73881c611a0f519576aa6ad2aa6799c2.tar.xz
Update dependencies (#333)
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]
}