title: How do you send an XMLHttpRequest to GAE with user info?
body: <p>How do you send an XMLHttpRequest to Google App Engine that identifies the logged in user?</p>
  
  <p>My site uses the built-in login system to get to the page, like this:</p>
  
  <pre><code>func handler(w http.ResponseWriter, r *http.Request) {
      c := appengine.NewContext(r)
      u := user.Current(c)
      if u == nil {
          url, err := user.LoginURL(c, r.URL.String())
          if err != nil {
              http.Error(w, err.Error(), http.StatusInternalServerError)
              return
          }
          w.Header().Set("Location", url)
          w.WriteHeader(http.StatusFound)
          return
      }
      fmt.Fprintf(w, "Hello, %v!", u)
  }
  </code></pre>
  
  <p>How do I include that user info when doing an XMLHttpRequest from that page to a different url handled by the same GAE app?</p>