golang-lib/web/session.go

14 lines
357 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-06-01 17:41:05 +02:00
// LoadSession module to start Session Handling in WebService
2021-06-01 10:51:35 +02:00
func (config *Service) LoadSession(r *gin.Engine) {
store := cookie.NewStore([]byte(config.Session.Secret))
r.Use(sessions.Sessions(config.Session.Name, store))
}