I am trying to decide whether I should use the variable isset or not for permission based, such as checking to see if the user is an admin or not. So far it has been working well using isset but doesn't quite work for one of my pages unless I omit the isset.
From my understanding, the first if condition uses isset because it is checking to see if the u_uid exists or not but I read then when comparing numbers like if the user is an admin or not, should I just use $_session without isset? I am a bit confused here
I tried both the with and without isset and for one of my pages, it works better using without isset
<?php
include_once __DIR__.'/header2.php';
if(!isset($_SESSION['u_uid'])) {
echo "<meta http-equiv='refresh' content='0;url=index.php?create_music_cat=notlogin'>";
exit();
} else {
if($_SESSION['u_permission'] == 0){
echo "<meta http-equiv='refresh' content='0;url=header2.php?create_music_cat=nopermission'>";
exit();
}
}