Why is jquery's .ajax() method not sending my session cookie?

后端 未结 11 1711
长情又很酷
长情又很酷 2020-11-22 02:25

After logging in via $.ajax() to a site, I am trying to send a second $.ajax() request to that site - but when I check the headers sent using FireB

11条回答
  •  情书的邮戳
    2020-11-22 03:06

    If you are developing on localhost or a port on localhost such as localhost:8080, in addition to the steps described in the answers above, you also need to ensure that you are not passing a domain value in the Set-Cookie header.
    You cannot set the domain to localhost in the Set-Cookie header - that's incorrect - just omit the domain.

    See Cookies on localhost with explicit domain and Why won't asp.net create cookies in localhost?

提交回复
热议问题