change cookie storage to localstorage