title: Dart lang, manipulating server returned JSON data in the client
body: <p>I want to check the user log in parameters, and if the parameters accepted, I want the server to send back to the client both the name and roles of the user, to be saved in the SeassonStorage for further usages.</p>
  
  <p>my server side code is:</p>
  
  
  
  <pre class="lang-dart prettyprint-override"><code>....
  ....   
    var users = &lt;Map&gt;[];
    var logged = &lt;Map&gt;[];   
  ....
  ....
   .then((_) {  
                    for (var user in users) 
                        if(_theData['userName']==user['Alias'] &amp;&amp; _theData['password']==user['Password'])
                    {
                      userFound=true;;
                      logged.add({
                                "Alias":user['Alias'],
                                "Roles": user['Roles']
                              });                     
                    }    
                  })
        .then((_) {
                  if(userFound == true)
                    res.write(JSON.encode(logged));
                  else
                    res.write('sorry, unknown loggin');
                  res.close();  
        });
  </code></pre>
  
  <p>in the client side, I've:</p>
  
  <pre class="lang-dart prettyprint-override"><code>....
  ....
  if(request.responseText != 'sorry, unknown loggen'){
      server_msg.innerHtml='Welcome';
      print(request.responseText);
      print(JSON.decode(request.responseText));
      var FonixLogin = JSON.decode(request.responseText);       
        print(FonixLogin['Alias']);
        print(FonixLogin['Roles']);
      Storage sessionStorage = window.sessionStorage;
        sessionStorage['FonixAlias'] = FonixLogin['Alias'];
        sessionStorage['FonixRoles'] = FonixLogin['Roles'];
  ....
  </code></pre>
  
  <p>the output I get is:</p>
  
  <pre class="lang-dart prettyprint-override"><code>    [{"Alias":"Admin","Roles":"admin"}]
      [{Alias: Admin, Roles: admin}]
      Exception: Illegal argument(s): Alias login.dart:66login_Element.onData
  </code></pre>
  
  <p>Why mistake I made here, so that the returned data is not saved properly in the </p>