angular-storage icon indicating copy to clipboard operation
angular-storage copied to clipboard

Unable to fetch String based cookies cause CookieStore is deprecated

Open robin-maxxton opened this issue 11 years ago • 3 comments

First of all. Good job on creating this library.

I do have one suggestion. While using the library I was unable to fetch a String based cookie from my list of cookies. The library wanted to have an cookie that was JSON based, but because my Sting based cookie was not set by using the library (set from a response header), it failed.

It seems the $cookieStorage is using Angular's $cookieStore. According to the Angular documentation this is a deprecated service. https://docs.angularjs.org/api/ngCookies/service/$cookieStore You should use the $cookies service instead. Please consider changing services to support the use of non JSON bases cookies. Thanks in advance.

robin-maxxton avatar Sep 15 '15 14:09 robin-maxxton

Create a PR for this https://github.com/auth0/angular-storage/pull/46 , in the mean time you can replace that module locally like this,

angular.module('angular-storage.cookieStorage', ['ngCookies'])
  .service('cookieStorage', ["$cookies", function ($cookies) {

    this.set = function (what, value) {
      return $cookies.put(what, value);
    };

    this.get = function (what) {
      return $cookies.get(what);
    };

    this.remove = function (what) {
      return $cookies.remove(what);
    };
  }]);

tyoungjr avatar Dec 02 '15 17:12 tyoungjr

:+1:

ebourmalo avatar Dec 16 '15 10:12 ebourmalo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

stale[bot] avatar Oct 26 '19 03:10 stale[bot]