Here is the official answer I got:
The real problem here is that you are trying to use the $cookieStore for the wrong purpose. The $cookieStore is an abstraction on top of $cookie, which works with objects and serializes them to JSON. If you want to assign the XSRF token then just use $cookie to write it, which works directly with strings.
In other words, one should do:
$cookies["XSRF-TOKEN"] = "my_token"; // Stored as: my_token
rather than:
$cookieStore.put("XSRF-TOKEN", "my_token"); // Stored as: "my_token"