title: how to work http header in cordova android?
body: <p>I am using the below method to call web service having basic authentication:</p>
  
  <pre><code>var url = 'http:sampleurl' + Username;
  $http.defaults.headers.common['Authorization'] = 'Basic ' + Base64.encode(Username + ':' + password);
  var session = 'Basic ' + Base64.encode(Username + ':' + password);
  $http({
      method: 'GET',
      url: url,
      headers: {
          cookie: session
      }
  }).
  success(function(data, status) {
      window.localStorage['userdata'] = JSON.stringify(data);
      console.log(JSON.stringify(data));
      $cookies.logged = 'success';
      window.localStorage['uname'] = Username;
      window.localStorage['pass'] = password;
      $scope.loginData = {
          username: '',
          password: ''
      };
      $state.go('app.tasklists');
  }).
  </code></pre>
  
  <p>This method working fine in ios platform of ionic app, but it is not working in android platform. In android platform header is not able to clear after a successful login. If i use a wrong password or different user the server return the first logged in user details.</p>