laravel / browser-kit-testing

Provides backwards compatibility for BrowserKit testing in the latest Laravel release.
MIT License
509 stars 75 forks source link

[6.0] Keep cookies between redirects #107

Closed kotfire closed 5 years ago

kotfire commented 5 years ago

This pull request makes followRedirects keep the cookies from the response when requesting to the new location.

I think the follow redirects should behave as browsers and all modern browsers keep the cookies after a redirect.

The changes should not break any existing code, but I am open to make it configurable via opt-in.

driesvints commented 5 years ago

This might be a breaking change if people were expecting cookies not to be kept between redirects.

kotfire commented 5 years ago

Makes sense, what do you think about making it configurable?

I would like to be able to set it to keep cookies for every redirect given this method is being called internally by other methods.

Something like $this->keepCookiesBetweenRedirects() or a shorter name that sets a property and check the property in the followRedirects method. Of course there would be another to disable.

driesvints commented 5 years ago

Makes sense, what do you think about making it configurable?

Hmm no. I think it's better if this were to be submitted to master instead.