LogIn Method
- Last UpdatedNov 06, 2025
- 2 minute read
The Login() method authenticates a user and, if successful, logs them on to a session.
The UserID parameter is by reference. When used within System Platform, this must be a locally declared string. For examples, see Logging into Sessions.
Parameters
- sessionId
Required. Holds the session ID and thus the user who is making this method call.
- userId
- Required. Holds the ID of the user who is logging on to a session. If empty and the “unique passwords” global option is set, then on success of the logon, this parameter is populated with the user_id corresponding to the specified password so that it can be tracked by the client application.
- userPw
- Required. Holds the user password for the given user that will be compared to the encrypted password stored in the database.
This method validates the supplied user and password and makes this user as an active user on this session if this method call succeeds. The sessionId parameter must identify a session that currently exists (created with the StartSession method).
The minimum password length is set by a system parameter. The supplied password cannot have blank spaces.
If this user does not have the required privilege to run this application, then the Middleware will raise an error message. The session is not terminated in case the client application lets the user return to the Login option.
If the “Passwords” system attribute (attrId=85) is set to “unique”, the userId input parameter should be set to the empty string “”. The userId corresponding to the unique password is returned. If the Login is successful then this user becomes the active user for the session (saved as the user_id field in the Sessn table).