Question: From Original website redirecting to another webapplication. After logining into that webapp, needs to redirect to original site along with the Cookie set in the redirected site. I can code only on original website code. is it possible to fetch the cookie set by the redirect site ? Consider both web apps running in same webserver.

Answer: 
Thanks for the help, but failed.

You are returning the following error:

```
Request failed: unacceptable content-type: text/html
NSLocalizedDescription = Request failed: unacceptable content-type: text/html.

```

I believe that the server is returning in `text/html` and the code is expecting JSON.
You can use AFN to do most of your network request. Hope this can help you.

```
- (Void) setAuthorizationHeaderWithUsername: (NSString *) username password: (NSString *) password {
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    //a NSDictionary parameter
    NSDictionary *parameters = @{@"name": username, @"pwd": password};
    [manager POST:@"http://example.com/resources.json" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
    //you can get JSON response in responseObject whether your request or wrong.
    NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error);
}];
}

```