Questions tagged [angular-cookies]

118 questions
0
votes
1 answer

reset user login session in angularjs

I store user auth info and token in a cookie locally for my angular/typescript SPA. Cookie expires after a certain time I have set. How do I reset expiration while user's activity? (session on the server is reset on users requests) I mean what…
quicky
  • 97
  • 2
  • 14
0
votes
1 answer

Angular Karma Testing $.cookie

My logout function sends a request to the logout api and clears all cookies effectively ending the session. It works really well but when I run the function in test, I get: ReferenceError: $ is not defined I know this comes from when, in the…
Peter Graham
  • 2,467
  • 2
  • 24
  • 29
0
votes
1 answer

$cookieStore not saving the data for another iteration of a method

I have an application where i have checkboxes for each item(configurations) from an array(configurationsArray). What i want to implement is to add the configuration to the cookie store when checkbox is checked Here is my code …
0
votes
1 answer

Angular $cookies are empty only when run under protractor

I have an Angular/Restangular application that appends a X-CSRFToken header to all POST requests to a backend REST API. The value of the header is extracted from $cookies.csrftoken. This is necessary because of a behaviour of the Django backend with…
0
votes
1 answer

making cookie name configurable

I am using angular ngCookies to read cookies. At present I am using this line to read cookie $cookies.MYCOOKIE The problem is that here I have to hard code cookie name, I have different cookie name in test/prod environment, but not able to find a…
coder
  • 4,458
  • 2
  • 17
  • 23
0
votes
1 answer

Properties disapear after getting the object form the cookiestore

I defined a $routeProvider that adds access to the route: $routeProvider.when('/tracks/:trackTitle/:mediaTitle', { templateUrl: 'views/track-detail.html', controller: 'MediaCtrl', access: access.user ... } I am listening to…
special0ne
  • 6,063
  • 17
  • 67
  • 107
0
votes
1 answer

Why is angular cookies accepting only strings, but not numbers?

When I was working with angular cookies, I found out that only strings are accepted by $cookies and stored in browser's cookie when set. i.e If I set the following cookies $cookies.id = 12345; $cookies.name = "Prasad"; Only $cookies.name is set in…
Prasad K - Google
  • 2,584
  • 1
  • 16
  • 18
0
votes
1 answer

LocalStorage with directive in AngularJS

I use ngStorage (https://github.com/gsklee/ngStorage) for storing some data in the localStorage of the browser. I have this markup
With a "card" (as u can…
-1
votes
1 answer

Angular js cannot save cookies instead it throw undefined error

hi I try to save in cookies after a web response. Here is my code angular.module('myApp').controller('SignInController',['WebService',function(WebService, $cookies){ this.formData = {}; this.signIn = function(formData){ …
e.k
  • 1,333
  • 1
  • 17
  • 36
-1
votes
1 answer

Angularjs: Angularjs ngCookie.js is giving some error

i tried to inject angular-cookies.js in my HTML file but seems it has some type error or to make it accurate an "error" in the js file. The error showing in my log is "TypeError: angular.module(...).info is not a function" and the js is from there…
Arnold wanna be
  • 463
  • 1
  • 5
  • 14
-1
votes
1 answer

Angular $cookies "Circular dependency found"

got this error "Error: [$injector:cdep] Circular dependency found: $cookies <- $cookies <- AuthService" with following code 'use strict'; angular. module('core.auth'). factory('AuthService', [ '$http', '$rootScope', 'ConfigService',…
vanless
  • 303
  • 1
  • 3
  • 13
-1
votes
1 answer

cookies does not work correctly in angularjs

I read a lot of articles but still can't make cookies work. I have a controller for login page, and this controller basicaly calls service that make a login. In service callback vunstion I set cookies: $cookieStore.uid =…
yu.pitomets
  • 1,660
  • 2
  • 17
  • 44
-7
votes
2 answers

How do you increment a cookie value?

I am wondering how you would go about incrementing cookies (by one, just to keep in basic.) var snacks = $cookies.get('fruitSnacks', 1); snacks ++;`
abejdaniels
  • 459
  • 6
  • 15
1 2 3 4 5 6 7
8