sometimes some characters such as ‘|’ in the cookie are replaced if the form uses POST method.
to resolve it, just pass cookie value using ‘encodeURIComponent’ like this:
var cookie = data.cookie;
var newData = {'cookie': encodeURIComponent(cookie), 'relationship':'Patient'}
Thread Starter
Asitha
(@asitha)
Unfortunately adding that did not solve the issue either.
I also tried changing the ajax type to both post and get, but still got the error.
First try directly accessing the server and see the result. Or try some REST Client extension https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
If that works and update the xprofile, then you should try to integrate in your app.
Thread Starter
Asitha
(@asitha)
When I generated a cookie and used that via the URL directly, it seem to work fine. But it doesn’t make any sense as to why it doesn’t work using ajax. It’s pretty much using the same method.
I logged the cookie value before it sent it over and it does have the ‘|’ in there.
I have seen this before. You need to debug and print values where you are using in js app. just alert them on every step and you will find the place. I’m sure it is the | sign and/or some character being replaced.
solution is using encodeURIComponent function.
Thread Starter
Asitha
(@asitha)
I think this might be an issue with cross domain. I’m going to rewrite the ajax call and see if using PHP to get the response will help. Will let you know tomorrow if that’s the case.