Query parameters don't work in streamlit cloud

Hi @Charly_Wargnier,

thanks for the reply :slight_smile:

I created a simplified version of my application to showcase the issue.

Streamlit cloud URL: https://share.streamlit.io/nflaig/st-query-params-test
Github repository: GitHub - nflaig/st-query-params-test: Application to test streamlit query params

The problem is that the initial query params are empty when running the application in streamlit could but it works perfectly fine when running it locally.

https://share.streamlit.io/nflaig/st-query-params-test?a=1&b=2 => initial query params: {}

http://localhost:8501/?a=1&b=2 => initial query params: { "a": "1", "b": "2"}

Also it has to be noted that I had to write the initial query params into st.session_state else the application would behave unexpectedly when setting new query params. This is related to already exisiting forum post and github comment/issue. So my best guess right now that st.session_state works somehow differently in streamlit cloud then locally but I am not sure how I can fix the issue on my side.

Edit: I switched from streamlit built-in sessions state (st.session_state) to the custom session state solution described here which seems to fix the issue.

Best regards,
Nico