I'm working on a project using node.js and express.js on server side, and angular.js on client side. I've set up authentication on server side using passport.js. So when I login the session cookie is set up and I can access the api via browser with no problem. But when I try to request the url of the api in angular.js with http, I get "cors blocked" (yeah, I made that up). Server allows credentials, client sends withCredentials: true. What is the problem?
Funny thing is server and client are not even in different domains. They are both in localhost. But since server "cors blocked" me in the very beginning, I've enabled cors.
So I have server and client in the same domain. Corse is enabled in server and I still can't send my cookies.
Response Headers
Access-Control-Allow-Orig... *
Connection keep-alive
Content-Length 33101
Content-Type application/json
Date Sun, 18 May 2014 15:02:41 GMT
Etag "-796401813"
X-Powered-By Express
access-control-allow-cred... true
Request Headers
Accept application/json, text/plain, */*
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cookie prgck=s%3AGb1ZXuD0uXHoBbFWIcrmkSFt.%2BNt0pdVa1%2BNhUNITAPOzPjmQxklPpDrdvQz%2BACj084o
Host localhost:1212
Origin http://localhost:8000
Referer http://localhost:8000/app/
User-Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
corsmiddleware? Are you simply using the defaults withapp.use(cors());or are you specifying options or ?