AJAX call, modal dialog and cookies storing integrated initially into user-auth