[<10>] ====== Handling Login Events ====== It may be necessary for your application to execute certain rules when a new user logs in. For example, your application may collect the statistics of how many users are online or how many users have been using the application. If you want to handle the login events in your application you need to define a special //login notification// and attach rules to this notification – see [[docs:2500_config_apps:0800_add_edit_rules|Adding/Editing Rules]]. To add the login notification to the business space version: - Right click on the "Notifications" node of the business space version in the Elements Tree to bring up the pop-up menu. - Select the "Add Login Notification" or "Add Login Notification Attempt" command from the pop-up menu (it will be greyed out if the login notification has already been added). A new notification with the pre-defined name ''LoginNotification'' or ''LoginNotificationAttempt'' will appear in the Elements Tree. The difference between the ''LoginNotification'' and ''LoginNotificationAttempt'' is that the first is sent when a user successfully logs into the system and the second one – when the user’s attempt to login fails. - The login notification has a special structure that you cannot change: * DevicePlatform * IsGuest * IsNativeMobile * LoginName - Name of the current user * ReferringURL - The URL that the user used to login * RemoteAddress - The IP Address of the client * SessionID - The session ID You can add other attributes to these. {{page>notes:notification_rules}} To turn off handling of the login events in the business space version delete the ''LoginNotification'' from the Elements Tree – see [[docs:2500_config_apps:0300_work_config_elements|Adding/Editing Configuration Elements]]. See also [[docs:2500_config_apps:2500_logout_events|Handling Logout Events]].