added server code to send information to browser via ajax when signing in