go-siris / siris

DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Full server hang after setting Flash Message and redirecting

Allendar opened this issue · comments

Go 1.8.3. Homebrew
macOS Sierra 10.12.6

The following code reproduces the error. You go to /. Then it redirects to /landing. Then if you go to the / url again (or any that you would define), the request hangs forever.

package main

import (
	"github.com/go-siris/siris"
	"github.com/go-siris/siris/context"
	"github.com/go-siris/siris/middleware/logger"
	"github.com/go-siris/siris/sessions"
)

func main() {
	app := siris.New()

	app.Use(logger.New())
	app.AttachSessionManager(sessions.New(sessions.Config{
		Cookie: "sid",
	}))

	app.Get("/", func(c context.Context) {
		c.Session().SetFlash("test", "testString")
		c.Redirect("/landing")
	})

	app.Get("/landing", func(c context.Context) {
		c.WriteString(c.Session().GetFlashString("test"))
	})

	app.Run(siris.Addr(":8085"))
}

Do you use the master branch?

No the 7.3.4 release. I'll try it on the master branch in a bit.

ok, I will also look into it.

Looked into together with @Dexus. Will be outphased in the next version, to use the normal Session functionality instead of the Flash helper-functions. Still a bug in the current release, but won't be anymore as it'll be deprecated in 7.4.0.