title: Why SSO is not working even after setting cookie in WKWebView?
body: <p>I have 2 applications, both app uses the WKWebview for SSO login. Both apps are working fine individually.</p>
  
  <p>Now let's take this below scenario.</p>
  
  <p>Suppose i logged in one app, retrieved the WKWebview cookie from this app &amp; set this cookie info in WKWebview of 2nd app.My expectation is SSO should work in 2nd app but it isn't working.  </p>
  
  <p>Below is the code i am using for Retrieving cookie from WKwebview after login from 1st app</p>
  
  <blockquote>
    <p>extension WKWebView {</p>
  
  <pre><code>@available(iOS 11.0, *)
  private var httpCookieStore: WKHTTPCookieStore  {
      return WKWebsiteDataStore.default().httpCookieStore
  }
  
  func getCookies(for domain: String? = nil, completion: @escaping ([String : Any])-&gt;())  {
      var cookieDict = [String : AnyObject]()
      if #available(iOS 11.0, *) {
          httpCookieStore.getAllCookies { (cookies) in
              for cookie in cookies {
                  print("cookie iterator started")
                  print("cookie=======\(cookie)")
  
                  if let domain = domain {
                      if cookie.domain.contains(domain) {
                          cookieDict[cookie.name] = cookie.properties as AnyObject?
                      }
                  } else {
                      cookieDict[cookie.name] = cookie.properties as AnyObject?
                  }
              }
              completion(cookieDict)
          }
      } else {
          // Fallback on earlier versions
      }
  } }
  </code></pre>
  </blockquote>
  
  <p>Below is the code i am using for setting cookie in WKwebview of 2nd app</p>
  
  <pre><code> let cookie= HTTPCookie(properties: [
                .domain: "dev.mycompany.net",
                .path: "/",
                .name: "PF",
                .value: "327y48234g2hgdhjwedguyw23oSYVbVLwf9",
                .secure: "TRUE",
               .version: 1,
               .expires: NSDate(timeIntervalSinceNow: (562225018+1000000))
                ])!
  
  HTTPCookieStorage.shared.cookieAcceptPolicy = HTTPCookie.AcceptPolicy.always
  HTTPCookieStorage.shared.setCookie(cookie)
  </code></pre>