title: How to clear session or Cookies from url in ios?
body: <p>I am hitting the JIRA api authentication url from <a href="https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication" rel="nofollow">https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication</a>.</p>
  
  <p>When I enter the right username and password, it returns the token in response but when I enter the wrong password and username then it is returning the same token. I cannot resolve this problem please can someone help me.</p>
  
  <p>I am using this code. </p>
  
  <pre><code>NSURL * urlToHit = [NSURL URLWithString:loginUrl];
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:urlToHit cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:300];
  NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[data length]];
  
  [request setHTTPMethod:[customizedHeaders valueForKey:HTTP_HEADER_METHOD_TYPE]?:@"POST"];
  //  NSLog(@"%@",[request setHTTPMethod])
  [request setValue: postLength forHTTPHeaderField:HTTP_HEADER_CONTENT_LENGTH];
  [request setValue:[customizedHeaders valueForKey:HTTP_HEADER_ACCEPT]?:@"*/*" forHTTPHeaderField:HTTP_HEADER_ACCEPT];
  [request setValue:[customizedHeaders valueForKey:HTTP_HEADER_CONTENT_TYPE]?:@"application/json" forHTTPHeaderField:HTTP_HEADER_CONTENT_TYPE];
  [request setHTTPBody:data];
  NSError *error = nil;
  NSHTTPURLResponse *response = nil;
  NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error];
  NSLog(@"~~~~~ Status code: %ld", (long)[response statusCode]);
  </code></pre>