1.5 KiB
1.5 KiB
session
Package session is a middleware that provides the session management for Flamego.
Installation
The minimum requirement of Go is 1.16.
go get github.com/flamego/session
Getting started
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()
}
Getting help
- Please file an issue or start a discussion on the flamego/flamego repository.
License
This project is under the MIT License. See the LICENSE file for the full license text.