How to monkeypatch the streamlit server to create a log out button

This user, Matt_N, said they were able to monkeypatch the streamlit server to create a log out button for Streamlit when using Cognito by deleting the AWSELBAuthSessionCookie cookie

Has anyone else done this that could provide more detail? I am very new to the concept of “monkeypatching”.

Ideally, streamlit would just support this natively but it seems like there are no plans for that