Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ package sessions

import (
"encoding/base64"
"github.com/valyala/fasthttp"
"math/rand"
"net/http"
"strings"
"time"

"github.com/valyala/fasthttp"
)

const (
Expand Down Expand Up @@ -66,6 +68,7 @@ type (

// New creates & returns a new Sessions(manager) and start its GC
func New(c Config) Sessions {
rand.Seed(time.Now().UnixNano())
c = c.Validate()
// init and start the sess manager
sess := &sessions{config: c, provider: NewProvider(c.Expires)}
Expand Down