aboutsummaryrefslogtreecommitdiff
path: root/sessions.go
diff options
context:
space:
mode:
authorshen_wen_hui <shenwenhui@zuzuche.com>2019-05-05 12:59:40 +0300
committershen_wen_hui <shenwenhui@zuzuche.com>2019-05-05 12:59:40 +0300
commitf83061d6d718ca255de55f64f92fc53203f68d33 (patch)
tree99509fd7c541f9d469dfd1ed2aa7ea6c9e775b91 /sessions.go
parentdc272174175f7f9647ee7184d4eba13ee98859a1 (diff)
update
Diffstat (limited to 'sessions.go')
-rw-r--r--sessions.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/sessions.go b/sessions.go
index 2d19c8a..ffdae5c 100644
--- a/sessions.go
+++ b/sessions.go
@@ -103,15 +103,17 @@ const registryKey = `webx:mw.sessions`
// GetRegistry returns a registry instance for the current request.
func GetRegistry(ctx echo.Context) *Registry {
- registry, ok := ctx.Get(registryKey).(*Registry)
- if ok {
- return registry
+ if v, ok := ctx.Internal().Load(registryKey); ok {
+ registry, ok := v.(*Registry)
+ if ok {
+ return registry
+ }
}
- registry = &Registry{
+ registry := &Registry{
context: ctx,
sessions: make(map[string]sessionInfo),
}
- ctx.Set(registryKey, registry)
+ ctx.Internal().Store(registryKey, registry)
return registry
}