1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 02:30:18 +00:00

fix bug: session id undecoded when destroy and sesssion memory provider push wrong

This commit is contained in:
iexploree
2016-03-01 10:51:47 +08:00
parent 67fbafb380
commit 477de9a3f3
2 changed files with 7 additions and 3 deletions

View File

@ -201,7 +201,9 @@ func (manager *Manager) SessionDestroy(w http.ResponseWriter, r *http.Request) {
if err != nil || cookie.Value == "" {
return
}
manager.provider.SessionDestroy(cookie.Value)
// fix bug: cookie.Value has been urlencoded, so should be decoded here
sid, _ := url.QueryUnescape(cookie.Value)
manager.provider.SessionDestroy(sid)
if manager.config.EnableSetCookie {
expiration := time.Now()
cookie = &http.Cookie{Name: manager.config.CookieName,