jQuery is trying to parse the HTTP response as a whole based on the JSON content type.
> JSON.parse("-1369082024195183657") -1369082024195183600
You can override it by telling jQuery that you are expecting a string by setting the dataType property in the $.ajax configuration:
$.ajax({ dataType : "text", url : "rest/Registration", success : function(data){
I think you do not need to do any arithmetic with the authentication identifier token, so you can just save it as a string.
source share