 
   @post: (url, data, callback) ->
     request = new XMLHttpRequest()
-    request.beforeSend = (xhr) ->
-      xhr.withCredentials = true
+    request.withCredentials = true
     request.open('POST', url, true)
     request.setRequestHeader('Content-Type', 'application/json')
     request.onload = () ->


  @get: (url, callback) ->
    request = new XMLHttpRequest
    request.beforeSend = (xhr) ->
      xhr.withCredentials = true
    request.open('GET', url, true)
    request.setRequestHeader('Content-Type', 'application/json')
    request.onload = () ->


  @getUser: ->
    request = new XMLHttpRequest
    request.withCredentials = true
    request.open('GET', '@{UserR}', false)
    request.setRequestHeader('Accept', 'application/json')
    request.send()
