I have a project which using a a REST API. Here when Isend a login request, they are sending me the response as JSON containg some data. Along with that in Response Header
Access-Control-Allow-Origin:*
Connection:keep-alive
Content-Length:239
Content-Type:application/json
Date:Fri, 19 Oct 2012 06:28:12 GMT
Server:Apache/2.2.22 (Amazon)
Set-Cookie:session=username; Path=/
Here we have a Set-Cookie
, but this cookie is not setting. I need this cookie to be setted, because for any other API access, the server will check for this cookie.
How can I resolve this Issue? What is the solution for jQuery AJAX response Header Set-Cookie method?
You can get headers from XMLHTTPRequest. This may help. Let me know if this is working.
I think the real issue here is that if you have your browser's privacy/cookie settings set to paranoid then some browsers (at least FF & IE) seem to ignore XHR based Set-Cookie headers.
Here's a link to some FF help that may be useful for your users. http://support.mozilla.org/en-US/kb/fix-login-issues-on-websites-require-passwords
I wish there were a better answer/workaround for this 8(