2022-10-02 11:38:30 +02:00
|
|
|
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) {
|
2022-10-25 06:19:56 +02:00
|
|
|
return entity.NewSession(s.conf.SessionMaxAge(), s.conf.SessionTimeout()).SetContext(c)
|
2022-10-02 11:38:30 +02:00
|
|
|
}
|