Javascript cookie assignment