feat(session): add session management utility

This commit is contained in:
2026-03-10 14:48:13 +01:00
parent d2f2558fdf
commit 581d1c5173
2 changed files with 136 additions and 0 deletions

20
unstable/session/types.go Normal file
View File

@@ -0,0 +1,20 @@
package Session
import (
"sync"
"time"
)
const Session_Lifetime time.Duration = time.Duration(120) * time.Second
const cookie_key string = "GSESSID"
type session struct {
mtx sync.Mutex
data map[string]any
expiry time.Time
}
type sessionManager struct {
sessions map[string]*session
mtx sync.Mutex
}