Strong Like Bull
Strong Like Bull

Reputation: 11297

How to read response headers from an ajax call in jQuery?

I am making an Ajax post request and I am getting the following as response headers:

Content-Type    application/x-www-form-urlencoded; charset=UTF-8
**Cookie**  CAKEPHP=ooec5sah43c3f2doemdhvi61q2
Host    test.domain.com
Referer http://test.domain.com/test/login.html
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
X-Requested-With    XMLHttpRequest

I want to get the Cookie value. How to get it in jQuery? I know only how to get the JSON back.

Upvotes: 0

Views: 1661

Answers (1)

James Lin
James Lin

Reputation: 26528

have a look at getResponseHeader() method

Upvotes: 1

Related Questions