【发布时间】:2015-07-20 19:58:44
【问题描述】:
喂?有人可以帮我在 CouchDB 上使用 AngularJS 进行 cookie 身份验证吗?
这是我的代码:
var app = angular.module('app', []);
app.controller('mainController', ['$scope','$http', function($scope,$http){
//Authentification cookie
$http.({
url: 'http://localhost:5984/_session',
method: 'POST',
headers: {
Accept: 'application/json',
Content-Type: 'application/x-www-form-urlencoded'
},
data:{
name: "packy",
password: "packy8"
}
}).then(function(response){
console.log(response.headers);
});
}
问题?我无法读取 AuthSesssion Cookie。
【问题讨论】:
-
请提供有关您遇到 cookie 问题的脚本的更多信息
-
这是我的代码,你能编辑一下吗?
标签: angularjs http authentication cookies couchdb