javascript - Chrome ignores Set-Cookie response headers from XMLHttpRequest within extension -


i have background page in chrome extension makes requests server. using chrome's debugging tools can see various set-cookie headers returned. however, subsequent requests not contain these cookies - chrome seems throw them away. results in each request made server being counted new session.

server-side have following headers set:

header("access-control-allow-origin: *"); header("access-control-allow-credentials: true"); 

client-side have withcredentials = true set on xmlhttprequest object.

i have address of server within permissions section of extension manifest.

i feel i'm close solution here - server responding correct headers can't quite work out why chrome decides not store cookies.

is there else need set in headers, xmlhttprequest object or manifest? or not possible?

i worked 1 out. trick put "cookies" permission extension manifest. that's not obvious because chrome extension documentation states it's required if you're using chrome.cookies api - i'm not.

you have enable third party cookies. may need totally different solution enabling third party cookies not want recommending.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -