Icon Saving Data To Local Storage

You can use the TPersistentStorage Set method to save a string to a specific key in local storage. The following example shows how to use a form method to store a user's display preferences in local (not per-session) storage so that they are present whenever the application is run:

uses WebCore, WebComps;

procedure TForm1.Form1Create(Sender: TObject);
begin
   DisplayPrefs:=TStringList.Create;
end;

procedure TForm1.Form1Destroy(Sender: TObject);
begin
   DisplayPrefs.Free;
   DisplayPrefs:=nil;
end;

procedure TForm1.InitDisplayPrefs;
begin
   with DisplayPrefs do
      begin
      Clear;
      Values['ShowMainMenu']:='True';
      Values['ShowToolBar']:='True';      
      end;
end;

procedure TForm1.SaveDisplayPrefs;
begin
   LocalStorage.Set('DisplayPrefs',DisplayPrefs.Text);
end;

procedure TForm1.LoadDisplayPrefs;
begin
   if LocalStorage.Exists('DisplayPrefs') then
      DisplayPrefs.Text:=LocalStorage['DisplayPrefs']
   else
      InitDisplayPrefs;
end;

Information The above code is not complete and is only a cut-down example to illustrate the specific local storage concepts discussed here.
Image