t1 OK
This commit is contained in:
parent
1c3000e532
commit
c255491b9c
4 changed files with 40 additions and 55 deletions
|
@ -132,13 +132,13 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
|
|||
func (manager *Manager) SessionDestroy(w http.ResponseWriter, r *http.Request) (err error) {
|
||||
var cookie *http.Cookie
|
||||
if cookie, err = r.Cookie(manager.cookieName); err != nil || cookie.Value == "" {
|
||||
return
|
||||
return fmt.Errorf("Get cookie from request failed: %v", err)
|
||||
}
|
||||
|
||||
manager.provider.Destroy(cookie.Value)
|
||||
rmcookie := http.Cookie{
|
||||
Name: manager.cookieName, Path: "/", HttpOnly: true,
|
||||
Expires: time.Now(), MaxAge: -1,
|
||||
Expires: time.Now(), MaxAge: -1, Secure: manager.secure,
|
||||
}
|
||||
http.SetCookie(w, &rmcookie)
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue