How to know if the user is already logged in to another device?

Asked

Viewed 226 times

0

I have an Android app that connects to the API of Parse.com, but it could also be another Restful API that I created myself. The question is how to control sessions on different devices?

Example, a user can only be logged into a single device at a given time.

1 answer

1

Matthew, from what I understand about Parse, you don’t do this kind of session control for you. I may be wrong, but Parse’s sessions are quite limited and only recently have they included the session validity feature, so you have an idea! Up to a few months the user session was eternal, remaining the same after he changed the password.

One solution would be to create your control. If your goal is to keep the data synchronized on multiple devices one way would be to log all user’s details and create flags in their records informing the device that inserted or changed the record. Then through a Cloudcode you send msg to the devices that need to be synchronized again.

I think this would be a way.

  • Actually, I looked in other forums, and one solution was in the facilities table to create a field to control whether or not the session is active.

  • I confess that I am having so many problems with Parse’s REST and Cloudcode that I am considering fixing the solution and developing my own. It works really well for the basics, but once you need more control the thing gets complicated enough. Good luck out there.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.