Cookies lost on redirect

The new version of requests seems to have problems passing cookies after a redirect. The response is wrong in the new version unless I use a session() to send the request.

**Version 1.0.3**

``` python
>>> import requests
>>> requests.__version__
'1.0.3'
>>> r = requests.post(url, data=data)
>>> len(dict(r.cookies).keys())
0
>>> len(r.text)
3889
>>> r.history
(<Response [302]>, <Response [302]>)
>>> r.history[0].headers['set-cookie']
'a=123; Path=/, b=345; Path=/, c=245; Path=/'
>>> r.history[1].headers['set-cookie']
>>> 
```

**Version 0.14.2**

``` python
>>> import requests
>>> requests.__version__
'0.14.2'
>>> r = requests.post(url, data=data)
>>> len(dict(r.cookies).keys())
3
>>> len(r.text)
9069
>>> r.history
[<Response [302]>, <Response [302]>]
>>> r.history[0].headers['set-cookie']
'a=123; Path=/, b=345; Path=/, c=245; Path=/'
>>> r.history[1].headers['set-cookie']
>>> 
```


You're right that Requests is misbehaving, though your particular code example doesn't entirely demonstrate that:

``` python
>>> import requests
>>> requests.__version__
'1.0.4'
>>> r = requests.get('http://www.google.com/') # I get a redirect here because I'm in the UK
>>> r.history
(<Response 302>,)
>>> print dict(r.history[0]cookies()).keys()
['PREF', 'NID']
>>> print r.request.headers['Cookie']
None
```


Hmm, wonder if `requests.get` should return the cookies of the session rather than the request. 


It's not just that, I don't think the cookies are being sent to second url, I'm getting a different response using requests.post vs session.post 


The plot thickens:

``` python
>>> import requests
>>> requests.__version
'1.0.4'
>>> cookies = {'cookies': 'are awesome'}
>>> r = requests.get('http://httpbin.org/redirect/1', cookies=cookies)
>>> r.history
(<Response [302]>,)
>>> r.request.headers['Cookie']
'cookies=are awesome'
```

Tell me, @leechou, are you being redirected to a different domain or path?


same domain, different path. 


It seems to happen with redirects and cookies being set at the same time.
The example from the docs(issue #1078) currently fails because of this.
The cookies are set on the first response(accessible through response.history) but not the response from the redirect.

```
import requests
url = 'http://httpbin.org/cookies/set/requests-is/awesome'
r = requests.get(url)
print r.history[0].cookies['requests-is'] # This works
print r.cookies['requests-is'] # This one fails
```


So, I've looked into this a bit more and I don't think there's a bug here, at least not as of v1.1.0.

``` python
>>> import requests
>>> url = 'http://httpbin.org/cookies/set/requests-is/awesome'
>>> r = requests.get(url)
>>> r.cookies # This will be empty.
<<class 'requests.cookies.RequestsCookieJar'>[]>
>>> r.request.headers # The cookie, however, was sent
{'Content-Length': '0', 'Cookie': 'requests-is=awesome',
'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*',
'User-Agent': 'python-requests/1.1.0 CPython/2.7.2 Darwin/12.2.0'}
```

As you can see, the cookie _was_ sent to the server, it's just that httpbin doesn't echo it back. We can see that here:

``` python
>>> print r.text
{
  "cookies": {
    "requests-is": "awesome"
  }
}
```

So, either this wasn't a bug or it got fixed. =) We _do_ need to update the documentation, but that's cool.


Actually, I retract that, what I just said was nonsense. There's still a bug. =)


No, I was right the first time, no bug. Final proof, I simulated the behaviour in Chrome. Check the headers on the 200 after the redirect:
![Screen Shot 2013-01-17 at 19 19 37](https://f.cloud.github.com/assets/1382556/75903/7eee106c-60db-11e2-97f1-8fca9c959c3d.png)

I'll fix up the documentation.


Thanks. 1.1.0 worked for me, still hope the response.cookies are the session cookies though.