0

Using Windows 10; Google Chrome Version 46.0.2490.71...strangely I see this happening when I am trying it out in an ember app session over a https on localhost. It works fine with non-https session.

When I attempt to setItem the following JSON in LocalStorage manually(from the F12 pane) or using JavaScript,

{"secure":{"authenticator":"authenticator:qui-authenticator","access_token":"gBtZwAX1rFcu3D1LLNLKJ53l7Eyc1z3k0Fp30Jl6U4MM4o8lz_odld5Fv8kSoorUexjdIAW1THv2kNmWiarUWsG6AAZHPmlnHJwTbI0JD5Dtq4_XNOIKfhmEoLaaweVU3gYF7NkXfVHuUoDbJZNw9PvX28OeHv9EUuqpPKwYcILvpCu9vncEQv3M2jrZk-RtMrg16zZ70UjgCVkhx8eJsZ2wz8NohmALPA46HXtDAgdWcsrX9KJvF9lVJfuQVorual-9fZMHZTudd__yEQJXRvD1Slc8TmckoaUUpvtz8Ijo2MzJkIC3-gyyPPi8BeQYpdPxCXlvEBRccAHv8tAHRONo9z7Li8wJUJCi79xmjtpVYwJ3AERryIAhXbuD6cVEWYrMFKe_P2fndqlECq1nP6c43XsCVuPq09sSmbhejc66J3iqpfs4poy67qa6uPKHPvTgFBpDrLv7YoIyxK-sL0bM6LCMPiJzj9ocEzZ9DsCnkoMpPnO2PefJidWrzspn","token_type":"bearer","expires_in":1209599,"userName":"aaa@yahoo.com",".issued":"Wed, 11 Nov 2015 02:42:12 GMT",".expires":"Wed, 25 Nov 2015 02:42:12 GMT"}}

...Chrome is truncating the JSON string to a value

{"secure":{}}.  

If I remove the last curly-brace }, it sets the value fine. Any idea what could be going on with this. The works fine in IE though.

Any pointers on what could be happening?

BTW - I ran into this issue when using ember-simple-auth - when the library is setting up the LocalStorage with the bearer token from the server, after a successful authentication attempt.

Thank you

Athadu

Athadu
  • 854
  • 7
  • 13
  • Seems to work fine here: http://jsfiddle.net/jfriend00/bfac83sr/ – jfriend00 Nov 11 '15 at 03:15
  • Thank you for the quick response. I missed mentioning - strangely I see it happening when I am trying it out in an ember app session over a https on localhost. It works fine with non-https session. – Athadu Nov 11 '15 at 03:22
  • You should never manually set Ember Simple Auth's store - that's not supported by the library at all and might or might not work. – marcoow Nov 11 '15 at 14:25
  • I am not setting anything manually in my app. The Simple Auth, when it is using setItem call on the LocalStorage - the value, which is the sample JSON I gave you above - is not getting persisted in the LocalStorage. When I go into Chrome's DEV tools - and then attempt to set it manually - for testing purposes - it doesn't work either. It works/persists the value, if I remove the last brace } character. – Athadu Nov 12 '15 at 01:37

0 Answers0