golang-lib/web/session.go

14 lines
327 B
Go

package web
import (
"github.com/gin-contrib/sessions"
"github.com/gin-contrib/sessions/cookie"
"github.com/gin-gonic/gin"
)
// LoadSessions starts session handling for s.
func (s *Service) LoadSession(r *gin.Engine) {
store := cookie.NewStore([]byte(s.Session.Secret))
r.Use(sessions.Sessions(s.Session.Name, store))
}