[1.5.x] Fixed #19585 -- Fixed loading cookie value as a dict

This regression was introduced by the 'unicode_literals' patch.
Backport of f08e739bc2 from master.