Fix header parsing and cookie saving
Merge pull request #3 from payutc/trecouvr/fix_cookie

Fix header parsing and cookie saving