title: Set Cookies for URL Request
body: <p>Currently I have an iOS app that pulls prices and data from websites. So far its been working well, but I want to make it more accurate. To do so, I need to set the cookies for the URL request that I'm currently using String(contentsOf: _) for.</p>
  
  <h2>Current Process</h2>
  
  <pre><code>let requestUrl: URL = URL(string: "http://www.samsclub.com/sams/search/searchResults.jsp?searchTerm=Apple")!
  
  var content: String?
  
  do {
      content = try String(contentsOf: requestUrl)
  } catch {
      print("Error while converting an NSURL to String: \(error)")
  }
  
  if content != "" {
      // I do things with the content of the requestUrl...
  }
  </code></pre>
  
  <h2>Could Use?</h2>
  
  <p>I thought that maybe I should use Alamofire instead to pull those website, and then parse the data.</p>
  
  <p>I need to set the cookie that changes the store number to search, but have been unable to find a way to do so. Bellow is the code I have for pulling the websites data <strong>without</strong> setting a cookie.</p>
  
  <pre><code>let requestUrl: String = "http://www.samsclub.com/sams/search/searchResults.jsp?searchTerm=Apple"
  
  Alamofire.request(requestUrl, method: .post).responseString { response in
      if let content: String = response.result.value {
          // I do things with the content of the requestUrl...
      }
  }
  </code></pre>
  
  <h2>Other Claims</h2>
  
  <p>I have found many different ways to set cookies through Alamofire that don't work, but if Alamofire isn't the way to do it, please inform me. I really need this to work, and I'm open to any and every suggestion.</p>