Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Parse store user session

Code for the login:

[PFUser logInWithUsernameInBackground:self.userTextField.text password:self.passwordTextField.text block:^(PFUser *user, NSError *error) {
    if (user) {
        [self performSegueWithIdentifier:@"LoginSuccesful" sender:self];
    }
    else {
        NSInteger code = [error code];
        NSString *message;
        if (code == 100) {
            message = @"No Internet Connection";
        }
        else if(code == 101) {
            message = @"Wrong credentials";
        }

        UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@"Error" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
        [errorAlertView show];
    }
}];

We can check whether user is logged or not with

if ([PFUser currentUser]) { 
    // user is logged
}

It means PFUser logInWithUsernameInBackground:password: download the user data and store it somewhere in iOS, I don't know whether it is in plist or another file, or maybe session.

Where does Parse Framework store user login session in iOS?

like image 805
Edward Anthony Avatar asked Feb 22 '26 12:02

Edward Anthony


1 Answers

I had a bit of a poke around an app of mine that uses Parse and found the following.

enter image description here

Inside Library/Private Documents/Parse there is a currentUser file, and this contains the JSON representation of your user.

like image 105
rickerbh Avatar answered Feb 24 '26 04:02

rickerbh