AmpersandJS / ampersand-sync

Provides sync behavior for updating data from ampersand models and collections to the server.
http://ampersandjs.com
MIT License
20 stars 28 forks source link

Getting access to resp w/ cookie? #49

Closed EvanCarroll closed 9 years ago

EvanCarroll commented 9 years ago

Is it possible to get access to a Set-Cookie in the success cb?

EvanCarroll commented 9 years ago

I see, it comes in the options (third argument) to the cb.

success( model, testResponse, options ) {
    var xhr = options.xhr;

However, XHR doesn't provide a helper for reading the cookie info: https://github.com/Raynos/xhr/issues/76

naugtur commented 9 years ago

As I responded in https://github.com/Raynos/xhr/issues/76 I suggest using a separate function for that. For ampersand-sync it'd be an added benefit of using the same implementation in the browser and node (request has some support fro cookies, but only for sending them if I read correctly)