LoginForm is another special Form type which is solely used for login purpose. If your application contains a LoginForm it will the first form displayed when a web session starts. A LoginForm can be created from uniGUI Wizard by following this path: File->New->Other->Delphi Projects->uniGUI for Delphi->Form.
Create a Login Form
This action will create a blank LoginForm which looks identical to a regular form:
A blank LoginForm
Sample LoginForm design
A LoginForm is a descendant of a built-in class named TUniLoginForm. Each application can only has one LoginForm. After adding LoginForm your application will show this form as default form when a new session starts. You need to add controls, event handlers and etc. to implement required functionality. Login behavior is controlled using Form's ModalResult. If LognForm returns mrOK it means a successful login which will proceed to MainForm. When ModalResult returns mrCancel it will terminate application. So what you need to do is to validate user input and once there is a valid combination of user name and password you must return mrOK as ModalResult.
procedure TUniLoginForm1.UniButton1Click(Sender: TObject);
ModalResult := mrOK; // Login is valid so proceed to MainForm
procedure TUniLoginForm1.UniButton2Click(Sender: TObject);
ModalResult := mrCancel; // Invalid Login exit from app
Once user is logged in and MainForm is displayed, there are two ways to terminate the session. You can terminate the session and return to LoginForm by returning mrOK as ModalResult or terminate the session by returning mrCancel. For security reasons existing session is always terminated before displaying the LoginForm. i.e. each new login.starts a new session by default.