photoprism/internal/session/session_new.go
Michael Mayer bac6ae0cbd Sessions: Add max age and timeout config options #98 #782
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-10-03 22:59:29 +02:00

12 lines
315 B
Go

package session
import (
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/internal/entity"
)
// New creates a session with a context if it is specified.
func (s *Session) New(c *gin.Context) (m *entity.Session) {
return entity.NewSession(s.conf.SessMaxAge(), s.conf.SessTimeout()).SetContext(c)
}