The code on the bottom of the page is from some leftover debug code on line 540:
<?php var_dump($_SESSION);?>
just delete that line.
On line 516 you have:
session_start();
You can't start a session in the middle of the page, and you can't start a session that has already been started (it is started on line2). You probably just have to delete that line.
Actually I see you seem to be trying to reset the session entirely on the bottom of the page... I think you have to delete the session start on line 536 as well. Really I don't think lines 530-536 are necessary.