Fix cookie parsing

Close #7