question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interact with local storage

See original GitHub issue

ideally, something like this:

# write something to local storage
st.local_storage.a = 1

# reload the session, etc., 

# read it back
a = st.local_storage.a

Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
kaisa-kucherenkocommented, Oct 13, 2022

Hi! I also use local storage to save the results of the application so that the user can continue where he left off (closed the tab or browser). The local storage was selected because cookies have limits on the size of the stored data. Now I’m doing it with the streamlit_javascript module, but if it was native with streamlit and optimize for it would be great!

2reactions
sg-scommented, Sep 22, 2022

@jrieke thanks for the response! one concrete use case is for my vocabulary app built using streamlit

i would like to keep track of user scores and performance, and local storage is great because i don’t need anything server side, and user data is private.

other uses i can think of:

  • an app with lots of settings for some view. i can cache those settings in local storage so that when the user comes back to the app, it is in the state they left it in. st.session_storage doesn’t work because this will persist across sessions
  • simple customization of apps – does the user want the app to behave a certain way? we can now remember that
  • small data storage. e.g., watchlists or saved items can be stored locally
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using localStorage with React Hooks - LogRocket Blog
Learn how using localStorage with React Hooks can persist user information in browser storage and share logic between multiple components.
Read more >
How to Use localStorage with React Hooks to Set and Get Items
localStorage is a web storage object that allows JavaScript sites and apps to keep key-value pairs in a web browser with no expiration...
Read more >
Local Storage in React - Robin Wieruch
A neat custom React Hook that shows how to use local storage in React to store state. You can just use it in...
Read more >
Window.localStorage - Web APIs | MDN
The localStorage read-only property of the window interface allows you to access a Storage object for the Document's origin; the stored data ...
Read more >
Local Storage And How To Use It On Websites
Storing information locally on a user's computer is a powerful strategy for a developer who is creating something for the Web.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found