Skip to content

Commit

Permalink
Merge pull request #37 from tslling/master
Browse files Browse the repository at this point in the history
fix clear session passed wrong argument (#36)
  • Loading branch information
bbiao authored Jan 22, 2021
2 parents 87e080a + b64f4d2 commit bb98bc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,15 @@ func (c *Client) setSession(id string, ticket string) {
func (c *Client) clearSession(w http.ResponseWriter, r *http.Request) {
cookie := c.getCookie(w, r)

if s, ok := c.sessions.Get(cookie.Value); ok {
if err := c.tickets.Delete(s); err != nil {
if serviceTicket, ok := c.sessions.Get(cookie.Value); ok {
if err := c.tickets.Delete(serviceTicket); err != nil {
fmt.Printf("Failed to remove %v from %T: %v\n", cookie.Value, c.tickets, err)
if glog.V(2) {
glog.Errorf("Failed to remove %v from %T: %v", cookie.Value, c.tickets, err)
}
}

c.deleteSession(s)
c.deleteSession(cookie.Value)
}

clearCookie(w, cookie)
Expand Down

0 comments on commit bb98bc7

Please sign in to comment.