Skip to content


TWebLocalStorage is a component that can be used to access local browser storage. The storage is handled by the browser and coupled to the specific URL of the web application. From another URL, this local storage is not accessible. The TWebLocalStorage can be considered as a key/string value pair storage. With the class TWebLocalStorage it is easy to use.


 LLocalStorage: TWebLocalStorage
 LLocalStorage := TWebLocalStorage.Create;
 LLocalStorage.Values[mykeyname] := myvalue;
Or alternatively, you can also use the static method that reduces this code to:
 TWebLocalStorage.Values[mykeyname] := myvalue;
When the same URL is visited by the browser, the values stored from the last session can be retrieved. The TWebLocalStorage has an event OnChange. This event is triggered when the local storage of the app is modified in another browser document instance.