cookies - Cannot make ajax call between servers that differ only in port in HTML5/jQuery/Chrome stack -


the parts

i developing against 2 pylons servers , testing locally. 1 server on port 5000 , called server. other on port 7000. latter creates cookie specifies same domain used former server. essentially, first server uses credentials provided second server impersonate user.

the first server expects find auth token (a cookie, really) in response.environ @ run time. when authenticate on server on port 7000 , browser service on port 5000, latter server uses cookie created former , app works.

the fly in ointment first server creates html5 app uses ajax call second server, , cannot cookie included in ajax call. believe chrome (the browser using/requiring html5 support reasons) refuses send cookie cross domain reasons: going foo.net:7000 foo.net:5000 considered cross domain.

oh, , ajax call through jquery.

the question

is there way make ajax call html5 app created on port in same domain server in same domain different port?

what i've tried or discard out of hand

i not believe can use dynamic script tag insertion because making call javascript , html generated on client @ runtime other javascript. @ least, don't think desirable solution.

i don't believe access-control-allow-* applicable because going client server, not other way.

i've seen on jquery , ports in ajax calls. i've seen this, too.

i know same-origin policy.

and this not work.

agree michael simplest solution jsonp. in jsonp need configure server such supports jsonp. many servers deny keep data secure , sound. jsonp expect server send data in format can evaluated valid json. not case in every jsonp request , response. so, watch out that.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -