AJAX User Registration and Login with Cookie Autologin