0

I have a chrome extension where i store a cookie within the document.cookie. This is then refetched every time the user opens the popover.

I have used the Microsoft Edge convertor tool, to convert the extension to support the edge browser. This all worked as expected.

However a cookie is never persisted, is this a limitation of the edge browser? or am i missing something?

I can set, and get the cookie straight after and it is never returned.

Copied below is the source for setting the cookie

var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));var expires = "expires="+ d.toUTCString();        
var path = "path='/'";
document.cookie = cname + "=" + (cvalue) + "; " + expires + "; path=/;";

Getting the cookie:

var ca = document.cookie.split(';');
for(var i = 0; i <ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') {
        c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
        return (c.substring(name.length,c.length));
    }
}

return ""; 
Haibara Ai
  • 10,703
  • 2
  • 31
  • 47
Dan
  • 1,447
  • 2
  • 14
  • 30
  • Could you please provide a complete sample (including the `manifest.json` and failing call part) for the purpose of testing? It will help a lot to find the root cause. – Haibara Ai Aug 17 '16 at 00:59
  • Hi Haibara, Thanks for finding this post. Please find a sample extension here: https://www.dropbox.com/s/y1yv1ggqx2y6oig/Edge%20Extension.zip?dl=0 – Dan Aug 17 '16 at 14:30
  • Weird, seems like a bug, I have filed a bug and you could also provide the feedback through https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer – Haibara Ai Aug 18 '16 at 01:47

1 Answers1

1

IE / Edge silently dropps cookies in the follwing situations:

On Top Level Domains, e.g. "example.com" On Domain Names containing underscores, e.g. "my_sub.doma.in"

https://blogs.msdn.microsoft.com/ieinternals/2009/08/20/internet-explorer-cookie-internals-faq/