Ajax.Request
(からPrototype.js
)に設定xhr.transport.withCredentials
するように指示する必要があります(true
クロスサイトリクエストヘッダーでCookieを有効にするため)。私は試して失敗しました:
Ajax.Request('http://otherSubdomain.host:port/', {
onCreate: function(request){
request.transport.withCredentials = true;
}
});
Access-Control-Allow-Origin
が設定され、request
成功しましたが、Cookieは送信されませんでした。
指摘するのは嫌ですjquery
が、ここでははるかに簡単なようexample solutionです。