Do we need to say the domain/cookie thing when that is standard cookie behavior? I think most folks know a cookie set by A.com won't be usable via B.com. (Then again, repeating such things wouldn't hurt.)
On Wed, Apr 22, 2015 at 10:47 AM, Josh Soref <jso...@blackberry.com> wrote: > Raymond wrote: >> So we don't have a FAQ yet. >> Is it time to start it? > > It's long overdue. > >> Here is my stab: >> >> Do cookies work in Cordova apps? >> >> There are two ways in which you may want to use cookies. The first is >> within XHR (Ajax) requests to remote resources. >> Unless you >> specifically remove them, your Ajax library will automatically use >> cookies in subsequent calls to remote APIs and resources you request. > > Some handwaiving necessary to indicate that a cookie set for one domain won't > be given to an unrelated domain -- yada yada. > >> So given that some API returns a cookie required for future calls, you >> can assume it will be automatically sent when your app hits it again. > > This overlooks normal cookies that you grow via the server setting them, or > via a sub-resource using document.cookie. > >> The other way your app may desire to use cookies is locally - ie >> within the app itself. This does not make sense within a Cordova app >> as it isn't running on a proper web server itself. If your intent is >> simply to store data for the app then you should make use the various >> existing methods (link to >> http://cordova.apache.org/docs/en/4.0.0/cordova_storage_storage.md.htm >> l#Storage) >> to store data locally. > > Pretty good. > > Note that /some/ platforms may have cookie support by accident if they in fact > are hosted (or temporarily hosted) on a web server. I'm not sure if we want to > say "you should not expect your app to be able to persist cookies for its own > use, because generally speaking Cordova applications aren't backed by a web > server and thus have no place to store cookies" or something like that. -- =========================================================================== Raymond Camden, Developer Advocate for MobileFirst at IBM Email : raymondcam...@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org