AJAX proxy forwarding shopping basket request to different subdomain, returning session cookie for basket
i have the following problem and i didn't really find information spe开发者_运维知识库cific enough for my particular situation, so please don't kill me if this is a dupe:
there is a webshop running under www.theshopdomain.com and i can not modify any of the source there. i only have an ajax api for adding products to a basket.
then i have a satellite shop that features a subset of products and runs under subdomain.shopdomain.com.
to add products to the cart under www.theshopdomain.com, the subdomain must call the ajax api. so far so easy, now the real problem:
when the first request with "addProduct" is called, this request must create a session on the main shop domain on behalf of the user, so that i am able to link to the main shop and the user will see his selections on the subdomain and is able to check out on the main domain.
the subdomain runs a rails application and now somehow this rails app must forward the request, and still somewhere along the way a session must be created on the main system to be used in the forwarded request.
how would you proceed on this? i'm not sure in which direction i'm supposed to look. the iframe hacks apparently don't work, since i can't modifiy stuff on the main domain.
thanks for any possible help or directions, anton
ok, problem solved. i managed to get an html file saved on the main domain's server and used the well documented iframe solution.
精彩评论