I have been going crazy over this piece of code and narrowed it down to the unset function. When I call unset on the session variable, PHP doesn't execute anything beyond that point. Can someone please help?
public static function print_session_notification() {
if( isset( $_SESSION['notification'] )) {
$session_notification = $_SESSION['notification'];
$output = '<div class="error">';
$output .= $_SESSION['notification'];
$output .= '</div>';
unset( $_SESSION['notification'] );
return $output;
}
}
I call print notification::print_session_notification(); from a header include. The header include is called by a function. The $notification object is global in the function that calls the header file.