Fix Cookie not Defined issues

if the webpage has no cookies the library throws an error.

this PR fix the issue