// Start a new session CRM_Core_Session::start(); // Set a variable in the session CRM_Core_Session::set('my_variable', 'Hello, world!'); // Retrieve the variable from the session $my_variable = CRM_Core_Session::get('my_variable'); echo $my_variable; // Outputs "Hello, world!"
// Start a new session CRM_Core_Session::start(); // Check if the user is logged in if (CRM_Core_Session::isLoggedIn()) { echo "User is logged in."; } else { echo "User is not logged in."; }The CRM_Core_Session class is part of the CiviCRM library, which is a popular open source CRM platform built on top of PHP and Drupal or WordPress. It is designed to be integrated into web applications and provides a wide range of features such as contact management, fundraising, event registration, and more.