Skip to content

Package session is a middleware that provides the session management for Flamego

License

Notifications You must be signed in to change notification settings

flamego/session

Folders and files

NameName
Last commit message
Last commit date
Nov 7, 2024
May 2, 2024
May 2, 2024
May 2, 2024
May 2, 2024
May 2, 2024
Dec 8, 2021
May 22, 2021
Nov 7, 2024
May 15, 2021
Nov 7, 2024
May 15, 2021
May 2, 2024
May 2, 2024
Mar 3, 2025
Mar 3, 2025
Mar 20, 2024
May 2, 2024
May 2, 2024
May 2, 2024
May 2, 2024
May 2, 2024
May 2, 2024

Repository files navigation

session

GitHub Workflow Status GoDoc Sourcegraph

Package session is a middleware that provides the session management for Flamego.

Installation

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

License

This project is under the MIT License. See the LICENSE file for the full license text.