Echo: Do you have any plan to add a session middleware?

Created on 2 May 2016  路  10Comments  路  Source: labstack/echo

Most helpful comment

All 10 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leoycx picture leoycx  路  4Comments

arun0009 picture arun0009  路  3Comments

syntaqx picture syntaqx  路  3Comments

toorop picture toorop  路  4Comments

younisshah picture younisshah  路  4Comments