The error is caused by deleting a cookie (when users logged out) that was already deleted or not there anymore.
This is actually a weird bug, the steps are:
User clicks the logout button
The authenticator deletes the cookie for this particular session
The cookie manager used by authenticator raises an exception KeyError telling the authenticator that the cookie was not there anymore, there is nothing to delete.
Was there a race condition?
This is a well known issue in github repo. For now you can bypass the error message with a try/except clause and continue the app’s execution. Rest assured that cookie is already deleted.
if st.session_state["authentication_status"]:
try:
authenticator.logout(location='main')
except KeyError:
pass # ignore it
except Exception as err:
st.error(f'Unexpected exception {err}')
raise Exception(err) # but not this, let's crash the app
Thank you! Yes, it fix the behavior with error displaying.
Lets have 2 users logged in. User_1 and User_2
If you logout under User_1 and refresh the page on User_2, User_2 will be logged out as well.
How can we be sure that sessions are different for each of users?
That is expected because of same comp and browser. Although on different tabs or pages, they are using the same browser and there is only one cookie used by authenticator on that browser on that comp, so deleting the cookie would wipe out all the entries in that cookie.
However if you create a new profile window (say guest) on same comp and browser (using google chrome) logging out in one window will not affect the other user in another window. So this is truly a different browser session and cookies are not shared. The same behavior is shown by multiple google account log in.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.