I am wondering if there is any way to save some information through a page refresh?
I am currently trying to build an app where I have the user input some information and then click the login button (using the native st.login). But that causes a page refresh when coming back to the app, which means the session_state is lost and I can’t access the previously inputted information anymore.
I do have a database setup, but the data I want to save is linked to a particular user and I don’t have any identifiable information to save it with before the login so I have no idea how I could retrieve it after.
I have been thinking about cookies, but I don’t know if they’d be a good use case for that and/or if they work correctly on Streamlit cloud (from my internet search it seems like it’s not really supported).
For sure that’d solve everything! I might just do that if I can’t find a solution. My current hope is to have the user fill out the input form before logging in, as I expect that to increase engagement (a quick Google search tells me that this concept seems to be called “gradual engagement”)
I’m not using a form or plain fields though, I’m using the new st.login function (and native auth in general, introduced in 1.42). It makes the process of setting up authentication a lot easier, but it requires a reload of the page (as opposed to a rerun), which is why session_state is lost (which it wouldn’t be with just a rerun).
Edit: Sorry, rereading my messages I realize where the confusion might have come from. When I talk about an “input form” in my previous message, I mean the inputs I am gathering from the user for an ML model my app is using, not anything to do with the log in itself. I don’t know if it’s clearer?