mohamedyehia Posted February 18, 2015 Share Posted February 18, 2015 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 cookiehere is the netwok inspector:Content-Length:0Content-Type:text/xml;charset=UTF-8Date:Tue, 17 Feb 2015 23:09:13 GMTP3P:CP="ALL"Server:Apache-Coyote/1.1Set-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 More sharing options...
marianol Posted February 18, 2015 Share Posted February 18, 2015 You need to use ngCookies for getting that.Check the post here: http://stackoverflow.com/questions/18513818/angularjs-cookie-read-response-value Link to comment Share on other sites More sharing options...
mohamedyehia Posted February 18, 2015 Author Share Posted February 18, 2015 I already used it and it returns null Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now