Multiple sessions on different platforms

I have multiple web apps and an app is like users to be able to log into the app and also a web app but it seems that a user can only have 1 session with parse and not be logged in on multiple apps at the same time without getting session invalid and logged out.

Is this possible with parse ?

When logging in, you can pass installationId property, like Parse.User.login({ installationId: 'somevalue' }). The session is considered duplicated (and therefore deleted) when it has the same user and same installationId of the new session. So if you come up with a way to generate a different installation id to each of your users using each of your apps, you should be able to keep the same user with two different sessions.

Awesome, thank you as always sir !

@davimacedo So my situation is a bit more complex regarding this. I dont actually make use of Parse.login

I basically auth the user on a 3rd party site then if that successful i return the user object including the sessionToken then client side I use become(SessionToken), is there anyway to become and also to specify the installationId

some pseudo code of the auth im working with

    const {email, password, type, mailist } = request.params
    let endpoint: string
    if (!email || !password || !type) throw 'invalid request';

    // other auth logic via another endpoint happens here
    const provider = {
        authenticate: () => Promise.resolve(),
        restoreAuthentication() { return true; },
        getAuthType() { return 'myAuth'; },
        getAuthData() {
            return {
                authData: {
                    uid: wpUser.uId,
                    id: wpUser.user_nicename,
                    token: wpUser.token,
                    referralCode: wpUser.referralCode                        

    const user: Parse.User & any = new Parse.User();  // added any because of issue with _linkWith and linkWith
          user.setPassword(password);  // store this so we can easily migrate later
    await user._linkWith(provider.getAuthType(), provider.getAuthData())   

    return user    

    } catch (error: any) {
       throw error;       

Are sessions deleted when you use Parse.User.become(), even though no installation ID is supplied as an option?

Would it help you if we simply added an option to Parse Server to not delete existing sessions?

@reptilehaus I believe the issue here is user.setPassword try setting revokeSessionOnPasswordReset: false to your parse config or remove user.setPassword

@dplewis I actually only added that a week ago just so that Iā€™m storing user passwords as well as using the custom auth object. The issue was ongoing before that was added

@reptilehaus Interesting. I wrote a test case and it passed. Can you write a failing test case?