Fix Bugs with UserAgent, Ajax Cases, use $_SESSION