Questions tagged [angular-cookies]
118 questions
1
vote
1 answer
In Angular 1.2.32 How can I set expiry to cookie?
I am using angular 1.2.32 in an old project and I need to know how can I set the expiry of cookie.
I am using ngCookies for it and trying to set cookie using below line:
$cookies.putObject("newotpcookieobject", '7668787', { 'expires': expiresValue…

Sushant Rawat
- 90
- 10
1
vote
0 answers
Angular does not send HTTP Only Cookie
I have a small Angular 7 Application, which stores the JWT used for authentication in a HTTP ONLY cookie. The cookie gets issued by a Node.js Server. For some reason, the cookie gets stored in the Browser, but is not sent back with HTTP requests…

benni0108
- 75
- 2
- 8
1
vote
1 answer
How to send cookies explicitly with GET request using AngularJs 1
I am working with angularjs - 1.6.
I need to send one http GET request to server along with a cookie explicitly.
I mean, I know once we get authorization done successfully, cookies are being sent with every http request automatically.
But in my…

Anubha Gupta
- 189
- 2
- 17
1
vote
2 answers
AngularJS $cookies 1.6.9 not working
I'm using AngularJS $cookies 1.6.9 to manage cookies on my website.
I've tried a simple cookie set, as follows:
$cookies.put('myCookieTest', 'test');
var cookie = $cookies.get('myCookieTest');
console.log(cookie);
I've installed angular-cookies…

Leonardo Minati
- 360
- 1
- 4
- 17
1
vote
0 answers
How to set expire time in cookies AngularJS (1.4)?
In case of user login I want to save the user data in cookies so that I can use that when the browser is closed and again open the website. For adding cookies I am using angular-cookies.js which given by angular.…

user3599830
- 25
- 1
- 9
1
vote
1 answer
Data only displayed after refresh AngularJS
I'm using plain controller to make cart system and $ngcookies. Everything works but the only thing that My Data (.name) only displayed at cart after browser refresh/reload, to be honest main HTML and Cart.html in different controller/view…

Andre Ramadhan
- 427
- 2
- 14
1
vote
1 answer
How to delete ngCookie (angular-cookies)
I created a cookie called 'stateCookie' when I start my app. As I change state I add variables into that cookie. When I logout, I want this cookie to be completely destroyed, or empty.
On their docs it's just remove() I've done that but the cookie…

Leon Gaban
- 36,509
- 115
- 332
- 529
1
vote
1 answer
how to set cookie expiration time in angularJs 1.3?
In my application I am using angularJS 1.3, when I using $cookies to store some values I need to set 1 min expiration time of cookie. The angularJs 1.3 $cookies service has not put method to supply expiration time.
this is the code I tried so…

Azad
- 5,144
- 4
- 28
- 56
1
vote
1 answer
Add/Delete angular2 ng2-cookies to a path
How to add and delete ng2-cookies from a specific path?

anusreemn
- 1,047
- 1
- 10
- 24
1
vote
1 answer
Removing cookies in angularjs
I have a problem removing cookies set to a particular domain.
When the cookies were set at say domain, a.b.io they were being deleted by this code.
$scope.clearStorage = function(){
$localStorage.$reset();
var cookies =…

Aniruddha Bhondwe
- 821
- 12
- 18
1
vote
1 answer
How to keep ngCookies after closing browser?
I want to keep my ngCookies after I close the browser.
After some research I tried this solution:
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 1);
$cookies.put('authenticated', true, {expires: expireDate});
But it sadly…
user5864072
1
vote
1 answer
AngularJs: use cookies inside custom service
I tried to use angular cookies in custom service, but got the error:
Unknown provider: ngCookiesProvider <- ngCookies <- checkLoginService
I store module, controllers and services in separate files.
Controller:
(function() {
'use strict';
…

Roman
- 35
- 6
1
vote
1 answer
How to specify a particular provider of a bower dependency
I want to use angular-cookies from bower but when I do:
bower install angular-cookies it sometimes fetches the one published by the angular team and sometimes some other old incompatible one from an independent author (angularify)
If I do manage to…

Rob Shepherd
- 866
- 1
- 9
- 25
1
vote
0 answers
AngularJs $cookies not working with $window.location.href
Hi I am just learning the AngularJS, and trying to save cookies values
I have two html file
index.html
Title
…

Saurabh Tyagi
- 111
- 1
- 4
1
vote
1 answer
Angular cookies not returning same value at different url
Currently I am implementing angular cookies to retain information. This is the way I add information.
oItems is the javascript array of objects.
Angular Versoin…

89n3ur0n
- 921
- 11
- 24