diff --git a/application.go b/application.go index 9657ddf..3da2941 100644 --- a/application.go +++ b/application.go @@ -329,6 +329,9 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) { if len(token) == 32 { sessionId = token //没有token,则查阅session + if cookie == nil || cookie.Value != sessionId { + needSetCookie = sessionId + } } else if err == nil && cookie.Value != "" { sessionId = cookie.Value //session也没有则判断是否创建cookie