Fixed missing $_SESSION['sid'] variable