Package session is a middleware that provides the session management for Flamego.
go get github.com/flamego/session
package main
import (
"github.com/flamego/flamego"
"github.com/flamego/session"
)
func main() {
f := flamego.Classic()
f.Use(session.Sessioner())
f.Get("/", func(s session.Session) {
s.Set("user_id", 123)
userID, ok := s.Get("user_id").(int)
// ...
})
f.Run()
}
- Read documentation and examples.
- Please file an issue or start a discussion on the flamego/flamego repository.
This project is under the MIT License. See the LICENSE file for the full license text.