6

I've created a signUp function for my app to call, and the Parse.com backend JS code to sign the user up.

Sure enough, the user will appear in the database. Heck, I even got the verification email to be sent (something that was much harder than it should be. It is a setting under the "settings" section of the main parse backend, not something that is programatically set).

Now I'm trying to get the sessionToken from the newly signed up user. Returning the "user" object on success of the signup and inspecting, I don't see a "sessionToken". I also don't see a sessionToken in the user database...

Can somebody give me some code that will return the sessionToken?

Here is the relevant code:

user.signUp(null, {
  success: function(user) {
    response.success(user);
  },
  error: function(user, error) {
    alert("Error: " + error.code + " " + error.message);
  }
});

I don't get a sessionToken here. Where do I get it from?

2
  • 4
    It is odd that the Android and iOS libraries include a sessionToken but there is absolutely no reference to the sessionToken in the Javascript API.It looks like according to parse.com/questions/… that the javascript api just stores the session token into a cookie. Take a look at your cookie values. I bet you can pull it out of there directly. Commented Feb 27, 2013 at 12:12
  • @rdrobinson3 hey man, can you write up what you wrote as an answer? Commented Jun 22, 2013 at 22:26

2 Answers 2

6

I think you need to check on your local storage:

Local Storage Report

There are 5 items in local storage, using 0.9KB (0.001MB)

Parse/bqfSO3dVttG65a8CIkC1SdqC0CCqiqYsp1EfsjL8/currentUser

username [email protected]
email [email protected]
objectId oVGKr1vdbG
createdAt 2013-03-20T17:17:54.815Z
updatedAt 2013-03-20T17:17:54.815Z
_id oVGKr1vdbG
_sessionToken 12aob7us2lj18pkaddkbvsal7

That is what Parse checks when you do:

var currentUser = Parse.User.current();
var sessionToken = Parse.User.current()._sessionToken;
Sign up to request clarification or add additional context in comments.

Comments

0

The code i ended up using looked something like this:

endpoint : "https://api.parse.com/1/login",
    parameters : getTheLoginParametersFrom(user),
    success : function(response) {
        tablesModule.saveSessionId(response.sessionToken);
    }
}

Where the result from the "login" is the response.sessionToken.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.