kennethreitz/requests — Issue #346: Check cookie's expiry time when using sessions
Author: sajal
Created: 2012-01-10 08:31:50+00:00
State: open

Hi,
Just stumbled across requests, makes things a lot easier for me.

One thing i came across, was one site im trying to request, sets some expired cookies (along with genuine cookies). The set cookie would look something like this

````
'_xxxx=deleteMe; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, yyyy="delete me"; Version=1; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, zzzzz="000000000000000000000"; Version=1; Max-Age=1799; Expires=Tue, 10-Jan-2012 08:36:05 GMT; Path=/, yyyy="delete me"; Version=1; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
````
and so on...

In the case of request , it resends the Expired cookies, but real browsers do not! My guess is that this site uses such cookies to possible detect non-browser users. In the above example only zzzz should be sent on subsequent request, cause other cookies expired 32 years ago.

I built some very very ugly code to fetch the page using httplib2 and parse cookies myself, the code would only work on this particular site.. i thought requests may be a relief from my crappy code.