<...">

jQuery getJSON doesnt send cookies

i am including JS on domain1 form domain2 that script doesn onload and on button click a JSONP request to domain2 $.getJSON( 'http://www.domain2.com/process?callback=?', function(data){ if ( data ) processData( data ); } ); and then displaying the data on domain1. So here is my problem: The getJSON request doesnt send cookies to the domain2. The weirdest thing is that it does send the cookies half a day and the other half not. :-) This is how the request looks like when it doesnt work: Request details GET /ajax/embed-user-library?detail=98&callback=jsonp1312398534998 HTTP/1.1 User-Agent: Opera/9.80 (Windows NT 6.1; U; en) Presto/2.9.168 Version/11.50 Host: www.floowie.com Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: en,sk-SK;q=0.9,sk;q=0.8 Accept-Encoding: gzip, deflate Referer: http://www.sokker.cz/en/test2 Connection: Keep-Alive Response details HTTP/1.1 200 OK Date: Wed, 03 Aug 2011 19:06:51 GMT Server: Apache/2.2.16 (Debian) X-Powered-By: PHP/5.3.5-0.dotdeb.1 Set-Cookie: SESSID=64292b70dc28d7c6c9f13f70070353d8; path=/; domain=.floowie.com Expires: Mon, 26 Jul 1997 05:00:00 GMT Cache-Control: no-cache, must-revalidate Pragma: no-cache Content-Length: 34 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: application/json And this when it works(nothing changed in the scripts): Request details GET /ajax/embed-user-library?detail=99&test=1&callback=jsonp1312398534999 HTTP/1.1 User-Agent: Opera/9.80 (Windows NT 6.1; U; en) Presto/2.9.168 Version/11.50 Host: test1.floowie.com Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: en,sk-SK;q=0.9,sk;q=0.8 Accept-Encoding: gzip, deflate Referer: http://www.sokker.cz/en/test2 Cookie: __utma=254918925.1489796832.1301725317.1312260335.1312298033.44; __utmz=254918925.1312298033.44.11.utmcsr=sokker.cz|utmccn=(referral)|utmcmd=referral|utmcct=/en/test2; lang=en; FLWSESSID=ddd1bc696f83f5a70b5f0f3ae30b4691; __utma=121955676.1030804516.1282595153.1312390656.1312397285.194; __utmb=121955676.8.10.1312397285; __utmc=121955676; __utmz=121955676.1312397285.194.21.utmcsr=floowie.crmserver.cz|utmccn=(referral)|utmcmd=referral|utmcct=/index.php Connection: Keep-Alive Response details HTTP/1.1 200 OK Date: Wed, 03 Aug 2011 19:07:45 GMT Server: Apache/2.2.16 (Debian) X-Powered-By: PHP/5.3.5-0.dotdeb.1 Expires: Mon, 26 Jul 1997 05:00:00 GMT Cache-Control: no-cache, must-revalidate Pragma: no-cache Content-Length: 20 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: application/json Did someone see such a behaviour? Is it solvable? Thank you

以上就是jQuery getJSON doesnt send cookies的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏