moved cookie assignment into acllback