Skip to content

Instantly share code, notes, and snippets.

@rmax
Created May 16, 2010 15:50
Show Gist options
  • Save rmax/402946 to your computer and use it in GitHub Desktop.
Save rmax/402946 to your computer and use it in GitHub Desktop.
cookies = {}
for cs in response.headers['set-cookie'].split(';'):
data = cs.split('=')
cookies[data[0]] = data[1] if len(data) > 1 else data[0]
sessid = cookies['PHPSESSID']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment