You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a users sends a web request with for example an old cookie, or any key, it will be the id stored in the redis database. Shouldn't the save function following a New() call override the cookie id?
req, _:=http.NewRequest("GET", "http://www.example.com", nil)
req.Header.Set("Cookie", "session-key=a")
w:=httptest.NewRecorder()
// Get sessionsession, err:=store.New(req, "session-key")
iferr!=nil {
log.Fatal("failed getting session: ", err)
}
// Add a valuesession.Values["foo"] ="bar"// Save sessioniferr=sessions.Save(req, w); err!=nil {
log.Fatal("failed saving session: ", err)
}
// w set-cookie will be "session-key=a", rather than a random generated one.