if session exists php code example Example: check if session variable exists php Click to copyif (isset($_SESSION['errors'])) { //Do stuff }