@okld
I have beent thinking about your remark:
Unfortunately this will cause an error if you assign a key to a button, download_button, file_uploader or a form.
In which case would you need a key for a button? Can’t a callback function (on_click = …) work as an equivalent? I can’t think of a case where you would want to store the state of a button in session_state.