code: func decodeSessionCookie(c context.Context, r *http.Request) (string, error) {
  	cookie, err := r.Cookie(sessionCookieName)
  	if err != nil {
  		return "", nil // no such cookie
  	}
  	payload, err := sessionCookieToken.Validate(c, cookie.Value, nil)
  	switch {
  	case transient.Tag.In(err):
  		return "", err
  	case err != nil:
  		logging.Warningf(c, "Failed to decode session cookie %q: %s", cookie.Value, err)
  		return "", nil
  	case payload["sid"] == "":
  		logging.Warningf(c, "No 'sid' key in cookie payload %v", payload)
  		return "", nil
  	}
  	return payload["sid"], nil
  }
docs: // decodeSessionCookie takes an incoming request and returns a session ID stored
  // in a session cookie, or "" if not there, invalid or expired. Returns errors
  // on transient errors only.