1)
if(session_id() == "")
{
session_start();
}
2)
<?php
function start_session(){
static $started=false;
if(!$started){
session_start();
$started = true;
}
}
?>
3)
if (!isset ($_SESSION)) session_start();
These are three samples to avoid start session multiple times. It seems to me that the approach 3) is the best.
I would use approach 3), any advices on this issue? Will approach 1) or 2 be the best to use?
Thanks!