Fixed session.php bug and added user registration via ajax