Improve cookie parse
Add error console log