```python
  st.session_state.my_slider = 7
slider = st.slider(
      label='Choose a Value', min_value=1,
      max_value=10, value=5, key='my_slider')
  ```
Setting the state of button-like widgets: st.button, st.download_button, and st.file_uploader via the Session State API is not allowed. Such type of widgets are by default False and have ephemeral True states which are only valid for a single run. For example:
```python
  if 'my_button' not in st.session_state:
      st.session_state.my_button = True
st.button('My button', key='my_button')
# Throws an exception!
  ```
