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