It is possible to save the current user selection so it will be restored after page refresh or once the user travels between different pages. This state can be saved in local storage, session storage, or cookies.
Local storage is persistent storage
that keeps data even if the user closes the browser.
It will be cleared only when the user
clears the browser cache.
Session storage will be cleared when
the browser session is over,
typically when the user closes the browser.
Cookies may have an expiration date,
and also they are passed to the server.
'session-storage' or 'cookies'
Storage type. The default is an empty value.
any text value
If multiple pages have the same storage name,
they will share the same control state.
Cookie expiration in minutes.
Used for cookies only.
Default value -1 (The cookie expires when the user