UPDATE: RESOLVED → after much pain agony, here’s the solution for anyone else who pulls their hair out with this: they can co-exist if cookie controller is limited to two rerun chances to get cookie since it will never get cookie on the first rerun likely due to inner workings of session state it is establishing. If >2 reruns, do not invoke the cookie controller otherwise it will conflict with OAuth. It must go straight to OAuth logic at that point. The cookie controller cannot be a global variable but only conditionally invoked. It can never be invoked on the same rerun that OAuth might be triggered. It can be invoked on the same run as OAuth to set the cookie but only after OAuth has finished is job.
Original Problem:
I can authenticate with Google OAuth, yay…BUT, I can’t also initialize a cookie manager to save token. I’ve tried 3 different 3rd party streamlit cookie libraries and the identical problem persists on all 3 of them
- streamlit-cookies-controller
- extra_streamlit_components
- streamlit_cookies_manager
If any of those are initialized BEFORE OAuth executes, the script errors when OAuth runs due to some apparent dependency conflict.
Has anyone worked around this to implement OAuth while also initializing a cookie controller to persist data across sessions? I’m on 1.35.0