dsh0416 / session

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

session

GitHub Workflow Status Codecov GoDoc Sourcegraph

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

License

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

About

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

License:MIT License


Languages

Language:Go 100.0%