My extension works on an application, which requires user login. Once the user has logged in, I need to read the cookies and use them in my [XMLHttpRequest](http://en.wikipedia.org/wiki/XMLHttpRequest)s. 
So initially I need to check if the cookie is set, if not, I direct the user to the login page. Once logged in, I need to read the cookies and send it as part of my further requests.

How do I read cookies from a XMLHttpRequest or otherwise (if we don't even know the name of the cookie)

There is to function as getRequestHeader.. but what I need is something like that.