Something like this: https://github.com/gin-gonic/contrib/tree/master/sessions
Not sure but have you looked at this project https://github.com/xyproto/echoperm?
I will take a look. Thanks.
@haoxins this library only works for echo v1. But thanks for mention this library.
# github.com/echo-contrib/sessions
../../../echo-contrib/sessions/sessions.go:61: cannot use func literal (type func(*echo.Context) error) as type echo.HandlerFunc in return argument
../../../echo-contrib/sessions/sessions.go:62: c.Request undefined (type *echo.Context is pointer to interface, not interface)
../../../echo-contrib/sessions/sessions.go:62: c.Response undefined (type *echo.Context is pointer to interface, not interface)
../../../echo-contrib/sessions/sessions.go:63: c.Set undefined (type *echo.Context is pointer to interface, not interface)
../../../echo-contrib/sessions/sessions.go:64: c.Request undefined (type *echo.Context is pointer to interface, not interface)
../../../echo-contrib/sessions/sessions.go:148: c.Get undefined (type *echo.Context is pointer to interface, not interface)
I updated one of these to work with v2. Only the sessions part https://github.com/peppage/echo-middleware/tree/master/session
@peppage what about "Wrap echo with a context.ClearHandler"
*echo.Echo does not implement http.Handler (wrong type for ServeHTTP method)
have ServeHTTP(engine.Request, engine.Response)
want ServeHTTP(http.ResponseWriter, *http.Request)
You have a portable context, what do you want? Session written a couple of hours for a project of any complexity. Very lazy.
@painhardcore It works with normal Run method of Echo for me.
https://github.com/echo-contrib/sessions is already clearing the handler on line 70 of sessions.go and therefore stable! It's also migrated to v3.
Most helpful comment
https://github.com/echo-contrib/sessions