golang-lib/web/session.go

14 lines
326 B
Go
Raw Normal View History

2021-06-01 10:51:35 +02:00
package web
import (
"github.com/gin-contrib/sessions"
"github.com/gin-contrib/sessions/cookie"
"github.com/gin-gonic/gin"
)
2021-07-19 18:35:44 +02:00
// LoadSession starts session handling for s.
2021-07-19 17:59:47 +02:00
func (s *Service) LoadSession(r *gin.Engine) {
store := cookie.NewStore([]byte(s.Session.Secret))
r.Use(sessions.Sessions(s.Session.Name, store))
2021-06-01 10:51:35 +02:00
}