title: Magento 2 Add to cart using Ajax on response from other domain
body: <p>We have to add product into cart using on the bases of Ajax response from another domain on requesting Magento 2 Add to cart url or function. </p>
  
  <p>Request url or domain: xyz.com/checkout/cart/add/uenc/aHR0cDovL2NvbW1vbmNhcnQyLWxvY2FsLmJhbGZvdXIuY29tL3VjLXByb2R1Y3QtZGVtby10d28uaHRtbA,,/product/2/sid/6i79tqjdshfvt5o6avkhpb7jl4/category/1234567/id/2/
  Response domain: /localhost/</p>
  
  <p>So here is the problem:</p>
  
  <p>Product has been added to cart but while getting response customer cart session has been change to new and new quote id is created I.e fresh cart session will be created and existing products from the cart is wipeout and new added products will be shown only. Also on every response for the request having new session for cart.
  On using request url on the browser its working fine and product has been added to cart as expected.
  Issue is when we are using that add to cart funcatinality with ajax or adding product after response from local host domain has issue.
  I guess response is coming from cross domain that’s why its creating problem?. 
  If any one faced this kind of situation and have solution for Magento 2.1.6  will be appreciated.</p>
  
  <p>NOTE: This the way Iam using is working fine in Magento 1 versions but not working in Magento 2</p>