Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to share cookies between requests #41

Merged
merged 7 commits into from
May 27, 2019
Merged

Add the ability to share cookies between requests #41

merged 7 commits into from
May 27, 2019

Conversation

bastien-phi
Copy link
Contributor

No description provided.

@adamwathan
Copy link
Contributor

Thinking about the API for this a bit, I think it would be better if we didn't use a global cookie jar and instead withCookies took the cookies as a parameter.

So maybe the whole thing would look like:

$responseA = Zttp::get('http://foo.example');
$responseB = Zttp::withCookies($responseA->cookies())->get('http://bar.example');

Do you think that API is possible? Seems like we should be able to make it work by always using a fresh CookieJar instance for requests that don't say withCookies, or reuse the CookieJar that's passed in if it is passed in.

@bastien-phi
Copy link
Contributor Author

I will work on it ;-)

The cookie jar must be passed from the previous response to be used in another request
@bastien-phi
Copy link
Contributor Author

Hey @adamwathan , what about this PR ?

@justmd5
Copy link

justmd5 commented Nov 23, 2017

@adamwathan why not merge this pull?i need this very much!

@m1guelpf
Copy link
Contributor

Hey @adamwathan sorry to ping you but is there any chance of this getting merged?

@adamwathan adamwathan merged commit 6c9ac5d into kitetail:master May 27, 2019
@adamwathan
Copy link
Contributor

Merged and tagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants