Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexey Badyl 33 posts 205 karma points
    Nov 20, 2013 @ 16:38
    Alexey Badyl
    0

    Support of CORS requests (from sub domains)

    Hi,

    we have 2 servers under load balance - we should like to redirect all TC trafic to one server.

    So we have the following hosts: mysite.com(server 1) and shop.mysite.com + mysite.com(server 2)

    So when client on server 1 (mysite.com) add something to cart we whould like send POST to server 2 ( shop.mysite.com). I tried it via HTML api. So post from mysite.com was send to shop.mysite.com/base/TC/FormPost.aspx,  but by some reason new order line wasn't added.

    Are there any restrictions in FormPost.aspx when request are comming from other domains?

    For test I set for both servers Access-Control-Allow-Origin=*

     

    Thanks.

     

  • Anders Burla 2560 posts 8256 karma points
    Nov 21, 2013 @ 08:49
    Anders Burla
    0

    Hi Alexey

    is a new order created on shop.mysite.com when you POST from mysite.com? Just to know if the POST gets to the server.

    If the order is created try and check the database and see if it has the order lines in DB. If it does then I think I has something to do with the TC.GetCurrentOrder that will have an order object in the session cache and because of that - when you add order lines it will be done in the DB but not be communicated to other servers that the order has changed.

    Kind regards
    Anders

  • Anders Burla 2560 posts 8256 karma points
    Nov 21, 2013 @ 09:06
    Anders Burla
    0

    You might want to use the same domain for sharing cookies. You can add this to your web.config

    <httpCookies domain=".domain.com" />

  • Alexey Badyl 33 posts 205 karma points
    Nov 21, 2013 @ 22:38
    Alexey Badyl
    100

    After invetigation we disabled ajaxForm post. HTML Api become work via usual browser post request. 

    But we desided to not use this aproach, because a lot of our e-commerce functionality was written via Javascript Api. And here a lot of issues with sending cookies via CORS.

Please Sign in or register to post replies

Write your reply to:

Draft