package main import ( "gopkg.in/kataras/iris.v6" "gopkg.in/kataras/iris.v6/adaptors/httprouter" "gopkg.in/kataras/iris.v6/adaptors/sessions" ) func newApp() *iris.Framework { app := iris.New() app.Adapt(httprouter.New()) app.Adapt(sessions.New(sessions.Config{Cookie: "mysessionid"})) app.Get("/hello", func(ctx *iris.Context) { sess := ctx.Session() if !sess.HasFlash() /* or sess.GetFlash("name") == "", same thing here */ { ctx.HTML(iris.StatusUnauthorized, "