22 lines
440 B
Go
Executable File
22 lines
440 B
Go
Executable File
package config
|
|
|
|
import (
|
|
"log"
|
|
"time"
|
|
|
|
"github.com/gofiber/session/v2"
|
|
)
|
|
|
|
type SessionConfig struct {
|
|
*session.Session
|
|
}
|
|
|
|
// Setup configura el almacén de sesiones en memoria con expiración de 1 año.
|
|
func (s *SessionConfig) Setup(db DatabaseDriver) error {
|
|
s.Session = session.New(session.Config{
|
|
Expiration: 365 * 24 * time.Hour,
|
|
})
|
|
log.Println("[SESSION] Sesiones en memoria (expiran en 1 año o al reiniciar)")
|
|
return nil
|
|
}
|