Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dxvgef committed Jun 11, 2021
1 parent a3e421a commit f3c4ad7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ func (engine *Engine) Use(req *http.Request, resp http.ResponseWriter) (*Session
if req == nil || resp == nil {
return nil, errors.New("req和resp参数不为是空指针")
}

// 从cookie中读取session id
ck, err = req.Cookie("sessionid")
ck, err = req.Cookie(engine.config.Key)
if err == nil &&
ck != nil &&
ck.Value != "" &&
ck.Domain == engine.config.Domain &&
ck.Path == engine.config.Path &&
ck.Name == engine.config.Key {
ck.Value != "" {
hasKey = true
}

Expand Down

0 comments on commit f3c4ad7

Please sign in to comment.