What does isset($_SESSION) mean? I found the following code snippet-
if (!isset($_SESSION)) {
// php code
}
EDIT:
I found the following snippet in define.php of the facebook style chatting script
freichat :
if (!isset($_SESSION)) {
$this->frm_id = $_SESSION[$this->uid . 'usr_ses_id'];
$this->frm_name = $_SESSION[$this->uid . 'usr_name'];
}
if $_SESSION was not set previously then, how can the two session variables be assigned to other variables?
Summary from my comments:
issetdetermines if a variable is set and is not NULL.!negates the condition, soif (!false)will evaluate to true.$_SESSIONis a superglobal and will be available on the following conditions:Your
if (!isset($_SESSION))will evaluate to true when no Session exists yet. It will then execute the code in the if block. However, that code will not work. If you run this snippetyou will see that it outputs:
So unless I am missing something, I’d say the code in that chat script makes no sense.