Jump to content
We've recently updated our Privacy Statement, available here ×

can't access cookie from the response header?


mohamedyehia

Recommended Posts

Hello,

I'm using angularjs to access my report using rest api for jasper report server.However,I can't access the cookie from the response header although when i inspect it in the network,i saw the cookie

here is the netwok inspector:

  1. Content-Length:
    0
  2. Content-Type:
    text/xml;charset=UTF-8
  3. Date:
    Tue, 17 Feb 2015 23:09:13 GMT
  4. P3P:
    CP="ALL"
  5. Server:
    Apache-Coyote/1.1
  6. Set-Cookie:
    JSESSIONID=565C19461C057649F731EAD5C25E75D0; Path=/jasperserver/
 
my angularjs code:
 
$http({method : 'POST',url : $scope.baseReportURL+"/rest/login?j_username=jasperadmin&j_password=jasperadmin",withCredentials: true,headers : {'Content-Type' : 'application/x-www-form-urlencoded'}}).success(function(data, status,headers) {console.log(headers());$scope.headers = headers();console.log( $cookies.JSESSIONID);[/code]
the response header :
{date: "Tue, 17 Feb 2015 23:09:13 GMT", server: "Apache-Coyote/1.1", content-type: "text/xml;charset=UTF-8", content-length: "0", p3p: "CP="ALL""}//can't access the cookie and the $cookies.JSESSIONID = null;

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...