Prevent Cookies From Being Sent on AJAX Request

前端 未结 5 1155
庸人自扰
庸人自扰 2021-02-05 00:58

I have a web service that I invoke from script but that does not need any information stored in cookies. Anytime I make a request to the service, the cookie is sent along with i

5条回答
  •  执笔经年
    2021-02-05 01:22

    No, the cookie will always be sent.

    You could how your cookies are sent to the browser, and use the http flag on them, which means they won't be sent via javascript.

    Or (which lots of sites use), create a new subdomain which you never sent any cookies on.

提交回复
热议问题