Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting contentType to application/json leads to session cookie not being sent #257

Open
frankbolviken opened this issue Nov 23, 2016 · 1 comment

Comments

@frankbolviken
Copy link

frankbolviken commented Nov 23, 2016

I have something along this request:

return when(reqwest({
      url: 'the_url',
      method: 'post',
      type: 'json',
      contentType: 'application/json',
      crossOrigin: true,
      withCredentials: true,
      data: data
    }))

Session cookie is not sent, and I get an error on API because it interprets it as I'm not logged in.
Removing contentType leads to cookie being sent and api is happy, but I get unsupported media-type ofc because contentType is interpreted as "application/x-www-form-urlencoded".

What am I doing wrong?

@javaLuo
Copy link

javaLuo commented Nov 8, 2017

I have the same problem
this is a BUG ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants