|
|
|
@ -60,11 +60,11 @@ func SessionWithConfig(config SessionConfig) Interceptor {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SessionGet returns a named session.
|
|
|
|
|
func SessionGet(ctx *http.RequestCtx, name string) (interface{}, error) {
|
|
|
|
|
func SessionGet(ctx *http.RequestCtx, name string) (*session.Store, error) {
|
|
|
|
|
store, ok := ctx.UserValue(key).(*session.Store)
|
|
|
|
|
if !ok {
|
|
|
|
|
return nil, fmt.Errorf("%s session store not found", key)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return store.Get(name), nil
|
|
|
|
|
return store, nil
|
|
|
|
|
}
|
|
|
|
|