2

There is an object that I want to keep even if user press ctrl+F5. So I am trying it to save in the localstorage of browser. As localstorage can save only string data so I am strngify it

localStorage["objSocket"] = JSON.stringyfy(socket);

but this is showing

TypeError: Converting circular structure to JSON.

I tried even

$cookies.putObject("objSocket",socket);

this too is showing the same error.

Is there any other way to save the object even if user press ctrl+f5 ?

Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
  • Possible duplicate of [Chrome sendrequest error: TypeError: Converting circular structure to JSON](http://stackoverflow.com/questions/4816099/chrome-sendrequest-error-typeerror-converting-circular-structure-to-json) – Rajesh Dec 24 '15 at 06:46
  • 1
    check this [answer](http://stackoverflow.com/a/11616993/1398867) – Venugopal Dec 24 '15 at 06:52

0 Answers0