Michael Johnson
Posts: 0
Joined: Thu Mar 28, 2013 6:30 pm

I need clarification on when I can use cookies with a REST service

I am trying to determine the circumstances under which I cannot send and receive cookies from a REST service under Appery.

My current understanding is:

  • Cookies will not survive going through the REST proxy in either direction (or maybe you can send them but not read them?) So if you are letting someone preview your app with the builder test option, they will not be able to use any functionality that relies on cookies if the proxy is in use.

  • If you are using CORS, you should be able to use cookies with a REST service, even in the builder preview.

  • In a compiled mobile application with domain whitelisting, cookies are fully supported.

    So if I need to use cookies with a REST service, and I want people to be able to preview my app while it is in development, my options seem to be:

  • Use CORS instead of the proxy (requires a CORS-friendly service).

  • Build and distribute a real Beta app.

    Any other ideas? Setting up CORS isn't always possible since I can't always control the server. Building and distributing an app doesn't allow for instant feedback on new design ideas unless they are non-working mockups.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

I need clarification on when I can use cookies with a REST service

A REST service defined in Appery.io is a regular jQuery Mobile Ajax call. Your final app is running in the browser, not in Appery.io. So, you can use cookies anywhere supported/possible.

If you build a native (hybrid) app, then you don't need to worry about cross-domain calls.

Michael Johnson
Posts: 0
Joined: Thu Mar 28, 2013 6:30 pm

I need clarification on when I can use cookies with a REST service

So overall, are my assumptions pretty close to correct? If I can't get CORS working, people in my company who are giving me feedback on features using cookies would need to look at a "final app" on their device.

We are looking into using TestFlight for this -- makes it a little bit easier to distribute a real app just for testing, although nowhere near as convenient as Appery's preview mode.

Return to “Issues”