Fix URI::InvalidURIError raised when setting a cookie after loading a page with a space in the url (Fixes #349)
Merge pull request #353 from yaauie/fix-issue-349

Fix issue 349