What is the easiest way in PHP to determine if sessions are included in the php.ini file for a server. I want to pre-install for my PHP application and just need to check something.
if (!extension_loaded('session')) { die('You must enable PHP session support for the system to work.'); }
You can write a quick script:
<?php // page1.php session_start(); $_SESSION['my_index'] = "IT WORKED!";
Then on another page:
<?php // page2.php session_start(); echo $_SESSION['my_index']; //output: IT WORKED
if ( ! function_exists('session_start')) die;