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