Fixed encoding and decoding of cookie values

The value portion of a cookie has to automatically be urlencoded when sent and
urldecoded when received.

See: http://php.net/manual/en/function.setcookie.php