title: Parse for javascript - "error 209 invalid session token" when signing up a new user
body: <p>I wrote a simple function in an angularJS application for signing up new users:</p>
  
  <pre><code>$scope.registerUser = function(username, password) {
      var user = new Parse.User();
      user.set("username", username);
      user.set("email", username);
      user.set("password", password);
  
      user.signUp(null, {
        success: function(result) {
  
          console.log(result);
          $scope.registerUserSuccess = true;
          $scope.registerUserError = false;
          $scope.registerUserSuccessMessage = "You have successfully registered!";
  
          $scope.$apply();
  
          $timeout(function(){
              $state.go("user");
          }, 1000);
  
        },
        error: function(user, error) {
          $scope.registerUserError = true;
          $scope.registerUserSuccess = false;
          $scope.registerUserErrorMessage = "Error: [" + error.code + "] " + error.message;
          $scope.$apply();
        }
      });
  </code></pre>
  
  <p>Initially it worked fine, but when I deleted all the users directly through Parse.com, I can't sign up new users using this function anymore. Each time I get <em>error 209 invalid session token</em>. Here's a screenshot of my Parse database:</p>
  
  <p><a href="https://i.stack.imgur.com/R3gC5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/R3gC5.png" alt="enter image description here"></a></p>
  
  <p>I've googled the error message and the solution is always to log out the current user. However, if no users exist this isn't an action I can possibly take.</p>
  
  <p>So I would not only like to fix this problem, but also know how to prevent it in the future so my application can be used safely.</p>
  
  <p>Edit: I created a user directly in Parse.com, wrote a function to log in that user, but got the same error. I am completely stuck until this session issue is resolved.</p>