Skip to content

Commit

Permalink
SplitHostPort on DeleteSession (crewjam#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki2006 authored Mar 25, 2021
1 parent b119dc5 commit 0301c03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions samlsp/session_cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ func (c CookieSessionProvider) CreateSession(w http.ResponseWriter, r *http.Requ
// DeleteSession is called to modify the response such that it removed the current
// session, e.g. by deleting a cookie.
func (c CookieSessionProvider) DeleteSession(w http.ResponseWriter, r *http.Request) error {
// Cookies should not have the port attached to them so strip it off
if domain, _, err := net.SplitHostPort(c.Domain); err == nil {
c.Domain = domain
}

cookie, err := r.Cookie(c.Name)

if err == http.ErrNoCookie {
return nil
}
Expand Down

0 comments on commit 0301c03

Please sign in to comment.