I need to check if PHP session has already started. What is the method to check it?
For PHP >= 5.4.0
if (session_status() == PHP_SESSION_NONE) { session_start(); }
Source: http://www.php.net/manual/en/function.session-status.php
PHP < 5.4.0
if(session_id() == '') { session_start(); }
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
For PHP >= 5.4.0
Source: http://www.php.net/manual/en/function.session-status.php
PHP < 5.4.0