$ Cookies未设置即时

时间:2015-11-05 02:42:06

标签: javascript angularjs session-cookies angular-cookies

我被困在隐藏并在导航栏上显示登录/注销按钮。我在[{1}}属于loginCtrl设置了一些Cookie。并在login.html中获取属于homeCtrl的Cookie。这是我的代码;

home.html

我的导航栏:

.controller("loginCtrl", function($scope, $rootScope, $cookies, $state) {
    $scope.login = function () {
         Auth.$authWithPassword({}).then(function() {

             $rootScope.bekmez = true; // Using this in home.html > navbar.
             $cookies.put('Some', true);
             $state.go('baba.ana.manga');
})
.controller("homeCtrl", function($scope, $cookies) {

         $scope.bekmez = $cookies.get("Some");
)}

所以我做了一些谷歌搜索并找到了;

  

Cookie仅在摘要中添加到浏览器中。

我不知道摘要是什么。那么问题的解决方案是什么?

0 个答案:

没有答案