Fixed function for getting cookies, updated posit AJAX post request