diff --git a/steampy/login.py b/steampy/login.py index ec94b8b..50aeb32 100644 --- a/steampy/login.py +++ b/steampy/login.py @@ -51,12 +51,17 @@ def _send_login_request(self) -> Response: def set_sessionid_cookies(self): community_domain = SteamUrl.COMMUNITY_URL[8:] store_domain = SteamUrl.STORE_URL[8:] + community_cookie_dic = self.session.cookies.get_dict(domain = community_domain) + store_cookie_dic = self.session.cookies.get_dict(domain = store_domain) for name in ('steamLoginSecure', 'sessionid', 'steamRefresh_steam', 'steamCountry'): cookie = self.session.cookies.get_dict()[name] - community_cookie = create_cookie(name, cookie, community_domain) - store_cookie = create_cookie(name, cookie, store_domain) + if name in ["sessionid", "steamLoginSecure"]: + community_cookie = create_cookie(name, community_cookie_dic[name], community_domain) + else: + community_cookie = create_cookie(name, cookie, community_domain) + self.session.cookies.set(**community_cookie) - self.session.cookies.set(**store_cookie) + self.session.cookies.set(**store_cookie) def _fetch_rsa_params(self, current_number_of_repetitions: int = 0) -> dict: self.session.post(SteamUrl.COMMUNITY_URL)