jquery - Cannot get a cookie using ajax request and jqXHR object -
i made ajax request .i need access cookie or set-cookie properties. tried cookie headers of jqxhr object jqxhr.getallresponseheaders(). did not showed headers relating cookies. why? how cookie or set-cookie properties?
var jqxhr = $.ajax({ url: 'myurl, success: function(data) { // success, work alert(jqxhr.getallresponseheaders()); }, error: function(data) { // error, handle failure } }); update1: why firefox classify rejected cookies cookies received ajax?
update2: 4.7.3 getresponseheader() method
returns header field value response of field name matches header, unless field name set-cookie or set-cookie2.
maybe have @ jquery plugin:
https://github.com/carhartl/jquery-cookie
i' ve use before node.js socket application , works great!
Comments
Post a Comment