// CreateSessionIDer provides a default implement for extracting the session from a cookie jar func CreateSessionIDer(jar http.CookieJar) RequestIDer { return func(req *http.Request) string { for _, c := range jar.Cookies(req.URL) { if c.Name == RETSSessionID { return c.Value } } return "" } }
func getSessionId(jar http.CookieJar) string { key := "phpbb2mysql_sid" url, _ := url.Parse("egal") for _, cookie := range jar.Cookies(url) { if cookie.Name == key { return cookie.Value } } panic("no sessionid found") }
// MacaroonsForURL returns any macaroons associated with the // given URL in the given cookie jar. func MacaroonsForURL(jar http.CookieJar, u *url.URL) []macaroon.Slice { return cookiesToMacaroons(jar.Cookies(u)) }