Fix cookie reading.
Merge pull request #4182 from dereuromark/master-cookie

Fix cookie reading.