-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Hi,
I'm using the iOS SDK.
I have a simple login screen with one username textfield, one password textfield and one login button.
So far, when I tap the button, the user gets logged in with no difficulty.
The only thing I find weird is if the user taps the login button multiple times, a new session object is created for each tap in the mongo database. (so far, I'm just testing things, so the login view controller doesn't disappear, therefore the user is free to tap the login button time and time again).
All the session objects related to the same user have the same installationId and I thought that the previous sessions would be destroyed.
How could I destroy the previous sessions upon logging in if those sessions have the same userId / installationId pair ?
Steps to reproduce
Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.
- Create Login view controller in XCode and add UI elements to send username and password to
the server - Tap button to log in multiple times
- Wait for logins to be completed with success
Expected Results
One session object with the latest userid/installationid would exist in the database as per the documentation:
"Sessions represent an instance of a user logged into a device. Sessions are automatically created when users log in or sign up. They are automatically deleted when users log out. There is one distinct Session object for each user-installation pair; if a user issues a login request from a device they’re already logged into, that user’s previous Session object for that Installation is automatically deleted"
Actual Outcome
A new session object is created every time with no limit.
Environment Setup
-
Server
- parse-server version : 2.3.2
- Operating System: MacOS El Capitan
- Hardware: 16GB RAM
- Localhost or remote server? Localhost
-
Database
- MongoDB version: 3.0.6 and 3.4.1
- Storage engine: mmapv1 and wired-tiger
- Hardware: 16GB RAM
- Localhost or remote server? Localhost