$url = "https://example.com/newpage"; CRM_Utils_System::civiExit($url);
$errorMsg = "An error has occurred."; CRM_Utils_System::civiExit($errorMsg, "Error Title");
CRM_Utils_System::civiExit(CRM_Core_Error::sessionExpireErrorCode(), "Session Expired");This code closes the current session and displays a message indicating that the session has expired. In all of these examples, the `civiExit()` method is used to manipulate the system environment. This method is part of the `CRM_Utils_System` class, which is part of the CiviCRM package library.