Prevent ArgumentOutOfRangeException on empty cookie

An empty cookie would cause an ArgumentOutOfRangeException (edge case).

Correctly prevent ArgumentOutOfRangeException on empty cookie

Change the statement to actually prevent it ;)

Added test for empty cookie
Merge pull request #1564 from mloenow/patch-1

Prevent ArgumentOutOfRangeException on empty cookie