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

Get a cookie for future use #381

Open
luckyway7 opened this issue Apr 3, 2024 · 1 comment
Open

Get a cookie for future use #381

luckyway7 opened this issue Apr 3, 2024 · 1 comment

Comments

@luckyway7
Copy link

from steampy.client import SteamClient

login_cookies = {} # provide dict with cookies
steam_client = SteamClient('MY_API_KEY',username='MY_USERNAME',login_cookies=login_cookies)
assert steam_client.was_login_executed

Steampy has a method for logging in using cookies.
My question is how can I get these cookies if I am logged in using my username and password?

@sd702004
Copy link

sd702004 commented Apr 3, 2024

The ‍‍‍SteamClient class has a private property named _session, which is an instance of requests.Session(). Although _session is private and direct usage is discouraged, you can still utilize method _session.cookies.get_dict() for this purpose.

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

2 participants