Angularjs 1.4.x $cookies not working properly only in IE 11
<p><code>$cookies</code> not working properly in angularjs. using <code>$cookies</code> in a <strong>single page application</strong> to store true/false (stored as string).</p>

<p>prev version:</p>

<p>the code I wrote</p>

<pre><code>$cookies.put('displayUsers', $scope.somevalue, {expires:somedatetimevalue});
</code></pre>

<p>This worked fine but after few months, cookies where not working properly.
on investigation (in chrome) I found that there were two cookies with same name <code>displayUsers</code> created for same domain but paths were different.first path was <code>/demo/project1</code> and another was <code>/project1</code> . The url <code>/demo</code> is not part of the application and such url will redirect to totally different application.
everyTime the above <code>$cookies.put()</code> method was called it never updated cookie with path <code>/demo/project1</code>. Hence its value was always false.</p>

<p>To fix this issue I made cookie storing part path specific which <strong>worked fine in chrome</strong> but not in IE.</p>

<p>new version:</p>

<pre><code>$cookies.put('displayUsers', $scope.somevalue, {expires:somedatetimevalueinyears, path:'/demo/project1'});
</code></pre>

<p><strong>I also tried to delete the cookie before saving it, then also it didn't worked in ie.</strong>
I checked cookie value in console but it was always false for <code>displayUsers</code> cookie using <code>document.cookie</code> stmt.
If i clear browser data along with cookies and then try, it works fine in IE till now(not sure of consistency).</p>

<p>What could be the possibilities of failure if we don't clear history in IE?</p>

<p>Also I would like to know how cookie behaves in IE in both cases (when path is specified or not).</p>