0

I am setting some key in $cookieStore like $cookieStore.put('temp',temp); and saved ok in cookies but some where some bites of key value are changed ,

so when $cookieStore.get('temp'); I get this error :

Uncaught SyntaxError: Unexpected end of JSON input

at Object.parse (<anonymous>)
at Object.vc [as fromJson] (1.4.9_angular.min.js:15)
at Object.getObject (1.4.9_angular-cookies.min.js:12)
at Object.get (1.4.9_angular-cookies.min.js:13)

Please I need to know which can change the format of the value that cause the error when trying to get key value!

georgeawg
  • 48,608
  • 13
  • 72
  • 95
Anwar Badr
  • 31
  • 1
  • 5
  • Would you mind creating a demo on https://plnkr.co/edit to replicate this. also, its better to debug code with `angular-cookies.js` rather than using `angular-cookies.min.js` . The `min` files do not give proper readable messages – Shashank Vivek Sep 01 '19 at 05:31
  • @ShashankVivek , actually temp value is ``MDYwNzg4YWUtNjUzOC00NzYwLWI5MjItYzE4Y2E3ZDU0MDM5FvI4mk0s10gE+y0A`` and after calling ``$cookieStore.put('temp',temp);`` it became ``%22MDYwNzg4YWUtNjUzOC00NzYwLWI5MjItYzE4Y2E3ZDU0MDM5FvI4mk0s10gE%2By0A%22`` in browse cookies and this valid when trying to get , the issue occur when became like this ``MDYwNzg4YWUtNjUzOC00NzYwLWI5MjItYzE4Y2E3ZDU0MDM5FvI4mk0s10gE%2By0A`` and trying to get ``$cookieStore.get('temp');`` I am n't overriding it – Anwar Badr Sep 01 '19 at 08:23
  • Can you replicate this in https://plnkr.co/edit/5CV1I1dXSVA1hJxkgxsm?p=preview – Shashank Vivek Sep 01 '19 at 11:14

0 Answers0