add cookies and fix accept headers bug