Fix the issue when cookies were invalid under certain circumstances.

When a cookie value contains special symbols (+, =) it becomes invalid. This commit escapes them in the constructor.