Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎08-19-2013
My Device: Z10
My Carrier: Rogers

POST, PUT, and DELETE calls log user out of service

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?

Retired
Posts: 165
Registered: ‎09-24-2012
My Device: Passport
My Carrier: Bell

Re: POST, PUT, and DELETE calls log user out of service

emeryamiller,

 

" 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?

New Contributor
Posts: 2
Registered: ‎08-19-2013
My Device: Z10
My Carrier: Rogers

Re: POST, PUT, and DELETE calls log user out of service

anzor_b,

 

Yes, using the Z10 browser (on a physical phone) works fine with our mobile web app.

Highlighted
Retired
Posts: 165
Registered: ‎09-24-2012
My Device: Passport
My Carrier: Bell

Re: POST, PUT, and DELETE calls log user out of service

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.

http://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html

 

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?