Missing var

var keyword was missing at following line:
key = thisCookie.substring(prefixLength, thisCookie.indexOf('='));