javascript - Setting cookie across domains not working -
i'm developing webapp. i'm developing locally on machine, running on localhost:8000. app needs log in server running on machine @ localhost:8888. in production these on different subdomains.
my angularjs client code is:
postdata = new array('user_id=' + id, 'token=' + token); $http.post(url, postdata.join('&'), {withcredentials:true, headers: {'content-type': 'application/x-www-form-urlencoded'}}) .success(successhandler) .error(errorhandler);
my server returns cookie, cookie isn't sent on subsequent requests browser. server has following cors headers:
self.set_header('access-control-allow-headers', 'origin, content-type, accept, authorization') # self.set_header('access-control-allow-max-age', 21600) self.set_header('access-control-allow-methods', 'head, options, get, post') self.set_header('access-control-allow-origin', 'http://127.0.0.1:8000') self.set_header('access-control-allow-credentials', 'true')
i tried having 'access-control-allow-origin' '*', chrome said couldn't use wildcard domain when withcredentials true.
chrome still isn't sending header on subsequent requests server.
what doing wrong? i'm on osx , since running cordova i'm looking anything working now.
Comments
Post a Comment