>>
>>We have continued our investigations and worked around the problem by
>>implementing the A4D_PostExecutionHook to populate the response header
>>with the required headers to allow the cross origin request to our JSON
>>API.

>Theoretically those headers could be added within Active4D code.

That should be the case with your CORS implementation except that the a4d
executable is not invoked when an OPTIONS method request is issued that is
the reason why we had to implement a modified version the post execution
hook that looks for the request info to populate the response headers.


>>Despite a valid sid value being properly populated either as a query
>>string parm or a form variable during the post request, A4D does not seem
>>to find the session and give access to it in the executable.
>>It works fine if we issue a get request but not with if we issue a post
>>request.

>It could be because there is a bug in 'hide session field', if that is
>what you are using to put the >session id in the form. Use this:

><input type="hidden" name="<%= session local%>" value="<%= session id %>"
>/>

The problem does not come from there. Any POST request sent by angularjs
backend through AJAX to an A4D enabled 4D server is divided in two
requests, an OPTIONS request to verify the CORS credentials (origin,
content-type, Š) wich does not invoke the A4D executable execution and
than, if the first request is not rejected because of a CORS credential
mismatch, a POST request that seems not to be handled properly by
active4D, the session is not associated to the request even if sid is
passed as a query params.

Session id returns an empty string and a dump of the form variables return
_data_ and not individual variables.

A subsequent get request with the same sid works just fine, confirming
that the session is stil active.

Hope this helps,


-- 
Robert Ernens
HCTBA Consulting
Look2BookOnline - Web-à-la-Carte
4 Rés. Les Bois du Cerf
91450 Etiolles
Tél.: +33.950.58.95.80
GSM : +33.611.78.44.68




_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to