'URI malformed' fix

Prevent `URI malformed` browser-console error.

Added `try ... catch ... finally` for decoding cookie values.