Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session Not Terminating on Logout Request #388

Open
borisenko09 opened this issue Apr 18, 2024 · 0 comments
Open

Session Not Terminating on Logout Request #388

borisenko09 opened this issue Apr 18, 2024 · 0 comments

Comments

@borisenko09
Copy link
Contributor

Issue Description
We are experiencing an issue with the logout() function where the session does not terminate after making a logout request. Despite calling the logout endpoint, the session ID remains valid and subsequent requests (e.g., fetching wallet balance) are still successful, indicating that the session is still active.
Temporary Workaround
As a temporary workaround, we have implemented a method to explicitly clear the session cookies after the logout request. This method can be added to the SteamClient class:

def clear_session_cookies(self):
    self._session.cookies.clear_session_cookies()

This method should be called immediately after the logout attempt to ensure the client-side session is cleared:

@login_required
    def logout(self) -> None:
        url = f'{SteamUrl.COMMUNITY_URL}/login/logout/'
        data = {'sessionid': self._get_session_id()}
        self._session.post(url, data=data)

        if self.is_session_alive():
            self.clear_session_cookies()
            raise Exception('Logout unsuccessful')

        self.was_login_executed = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant