title: Setting cookie for URLSession dataTask
body: <p>I'm sending a post request to a rest api to authenticate:</p>
  <pre><code>let url = URL(string: &quot;http://192.168.0.103:8080/api/session&quot;)!
      var request = URLRequest(url: url)
      request.setValue(&quot;application/json&quot;, forHTTPHeaderField: &quot;Content-Type&quot;)
      request.httpMethod = &quot;POST&quot;
      request.httpBody = jsonData
      URLSession.shared.dataTask(with: request) {
          data, response, error in
          guard let data = data, error == nil else {
          [...]
          print(responseJSON)
      }.resume()
  </code></pre>
  <p>After that the HTTPCookieStorage contains a cookie that looks like that:</p>
  <pre><code>&lt;NSHTTPCookie
      version:1
      name:TEST
      value:16268645362559017
      expiresDate:'2021-07-21 23:59:59 +0000'
      created:'2021-07-21 10:48:56 +0000'
      sessionOnly:FALSE
      domain:192.168.0.103
      partition:none
      sameSite:none
      path:/api
      isSecure:FALSE
   path:&quot;/api&quot; isSecure:FALSE&gt;
  </code></pre>
  <p>Now if I send another request to the the same api to validate the cookie, the API receives the request but <strong>without</strong> the cookie.</p>
  <p>When sending a request from a JavaScript page or Postman, everything works.</p>
  <p>Any idea what I need to do to set the cookie to further requests?</p>