Webpage cookies are not detected by UIWebView
<p>I am developing iOS app that loads a webpage using <code>UIWebView</code></p>

<p>The web page sets four cookies:</p>

<ol>
<li>Two for Google Analytics, _ga and _gat</li>
<li>One for my web application unique vistors counter</li>
<li>One for my webpage to detect whether user has voted or not.

<ol>
<li>If this cookie available then display the poll results.</li>
</ol></li>
</ol>

<p>From Firefox's <code>Storage Inspector</code> I see all my cookies as expected, see screenshot:</p>

<p><a href="https://i.stack.imgur.com/YFqmh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YFqmh.png" alt="enter image description here"></a></p>

<p>However, from iOS I printed <code>NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies</code> from inside <code>webViewDidFinishLoad</code> and there is only two of four expected cookies, also iOS users can vote as many times as they wanted because cookies are not detected (or not stored in iOS device):</p>

<pre><code>if let cookies = NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies {
    for c in cookies {
        print("*******************")
        print("name: \(c.name)")
        print("domain: \(c.domain)")
        print("value: \(c.value)")
        print("path: \(c.path)")
        print("expiresDate: \(c.expiresDate)")
    }
}
</code></pre>

<p><a href="https://i.stack.imgur.com/kt3iz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kt3iz.png" alt="enter image description here"></a></p>

<p>Why my iOS app does not detect my custom cookies and only detects my Google Analytics ones?</p>

<p>NOTE 1: I have also added this code to my app:</p>

<pre><code>func applicationDidBecomeActive(application: UIApplication) {
    NSHTTPCookieStorage.sharedHTTPCookieStorage().cookieAcceptPolicy = NSHTTPCookieAcceptPolicy.Always
}        
</code></pre>

<p>NOTE 2: My backend is SharePoint web application</p>