Monitor User ActivityThe script continuously checks for user interactions such as mouse movements, clicks, or keyboard input.
Start Inactivity TimerIf no activity is detected, an inactivity timer begins counting down.
Display Warning MessageWhen the allowed inactivity threshold is reached, the system displays a warning message indicating that the user will be logged out in a specific number of seconds.
Reset Timer on ActivityIf the user performs any action (e.g., clicks or moves the mouse) during the warning period, the timer resets, and the user remains logged in.
Log Out UserIf no activity occurs within the warning period, the system automatically logs the user out for security purposes.