Skip to content

Commit

Permalink
fix: migrate session bug.🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
auula committed Apr 27, 2021
1 parent 5991298 commit 696e568
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .example/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
)

func main() {
sessionx.New(sessionx.M, cfg)
sessionx.New(sessionx.M, sessionx.DefaultCfg)
http.HandleFunc("/set", func(writer http.ResponseWriter, request *http.Request) {
session := sessionx.Handler(writer, request)
// 存储K的值
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (s *Session) MigrateSession() (*Session, error) {
newSession.(*Session).refreshCookie()

// Remove cache
mgr.store.Remove(&Session{ID: newID})
mgr.store.Remove(s)
mgr.store.Create(newSession.(*Session))
return newSession.(*Session), nil
}
Expand Down

0 comments on commit 696e568

Please sign in to comment.