Should I use
session_start()
or
if (session_id() == ""){
session_start();
}
because I remember correctly that without the latter there will be another error message?
Should I use
session_start()
or
if (session_id() == ""){
session_start();
}
because I remember correctly that without the latter there will be another error message?
Recommended way for versions of PHP >= 5.4.0
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
Source: http://www.php.net/manual/en/function.session-status.php
For versions of PHP < 5.4.0
if(session_id() == '') {
session_start();
}
Both of these should work for what you are asking for.