Skip to content

Commit 89f05ca

Browse files
committed
Set correct domain cookies into SteamGuardAccount Session
1 parent f2b5981 commit 89f05ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

BotLooter/Steam/SteamUserSession.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public SteamUserSession(SteamAccountCredentials credentials, RestClient restClie
4848

4949
private async ValueTask<bool> IsSessionAlive()
5050
{
51-
if (_cookieContainer?.GetAllCookies().Any(c => c.Name == "steamLoginSecure") == false)
51+
if (_cookieContainer is null)
5252
{
5353
return false;
5454
}
@@ -92,9 +92,9 @@ private async ValueTask<bool> IsSessionAlive()
9292
return (false, $"Не удалось получить веб-куки: {getCookiesResult.Message}");
9393
}
9494

95-
SteamId = ulong.Parse(getCookiesResult.SteamId ?? "0");
95+
SteamId = ulong.Parse(getCookiesResult.SteamId!);
9696

97-
var cookies = _cookieContainer.GetAllCookies();
97+
var cookies = _cookieContainer.GetCookies(new Uri("https://steamcommunity.com"));
9898

9999
var sessionId = cookies.FirstOrDefault(c => c.Name == "sessionid")?.Value;
100100
var steamLoginSecure = cookies.FirstOrDefault(c => c.Name == "steamLoginSecure")?.Value;

0 commit comments

Comments
 (0)