change cookie to localStorage