08-19-2013 02:59 PM
I have a working mobile web application that I am porting to a Black Berrry Web Works application. I am testing it with the VMWare Fusion emulator.
My application is backed by a Rails server. I can log in to the server using Ajax, and all subsequent GET requests work perfectly. However, when I do anything that submits a PUT, POST or DELETE request to the server, the request fails, and I find myself logged out.
In checking the web request headers, I notice that the same cookie is sent to the server for both GET and POST requests (it's encrypted, but the same encrypted string is sent). However the POST request fails and changes the cookie.
On the server side, I can see that cookie is received, but for some reason for POST requests it fails to detect the signed in user. I am continuing to troubleshoot this on the server side, to see why the user isn't logged in despite the cookie being the same, but I do not experience this in the mobile app (using the mobile browser) or on the desktop application which all use the same authentication mechanism.
Any ideas on why this might be happening?
08-21-2013 10:38 AM
" but I do not experience this in the mobile app (using the mobile browser) or on the desktop application which all use the same authentication mechanism."
Do you mean this works without issues when using the Z10 browser, but broken when using WebWorks?
08-21-2013 12:54 PM
WebWorks and the browser share the same code for cookie and session management.
If this web app works in the browser, it should work in WebWorks, but may require tweaking the config.xml file.
Sounds like you need to figure out why POST is failing, have you looked at the network tab in Web Inspector? You should see the failures there too.
FYI, WebWorks runs the file locally, which is close to running the index.html file by opening it in Chrome by filename (versus poining Chrome to a local web server which is hosting the app). Are there any issues when running app locally in Chrome?