Is this bad practice?
if ($_SESSION[\'something\'] == \'\') { echo \'the session is empty\'; }
Is there a way to check if its empty or
Use isset, empty or array_key_exists (especially for array keys) before accessing a variable whose existence you are not sure of. So change the order in your second example:
isset
empty
array_key_exists
if (!isset($_SESSION['something']) || $_SESSION['something'] == '')