Session middleware for EchoQuick StartDownload and install$ go get -u -v github.com/go-session/echo-sessionCreate file server.gopackage main import ( "fmt""net/http""github.com/go-session/echo-session""github.com/labstack/echo" ) funcmain() { e:=echo.New() e.Use(echosession.New()) e.GET("/", func(ctx echo.Context) error { store:=echosession.FromContext(ctx) store.Set("foo", "bar") err:=store.Save() iferr!=nil { returnerr } returnctx.Redirect(302, "/foo") }) e.GET("/foo", func(ctx echo.Context) error { store:=echosession.FromContext(ctx) foo, ok:=store.Get("foo") if!ok { returnctx.String(http.StatusNotFound, "not found") } returnctx.String(http.StatusOK, fmt.Sprintf("foo:%s", foo)) }) e.Logger.Fatal(e.Start(":8080")) }Build and run$ go build server.go $ ./serverOpen in your web browserhttp://localhost:8080foo:bar MIT LicenseCopyright (c) 2018 Lyric