diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Steam/src/api/session.h | 10 | ||||
-rw-r--r-- | protocols/Steam/src/steam_login.cpp | 7 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 3 |
3 files changed, 18 insertions, 2 deletions
diff --git a/protocols/Steam/src/api/session.h b/protocols/Steam/src/api/session.h index caf965803e..96fc560816 100644 --- a/protocols/Steam/src/api/session.h +++ b/protocols/Steam/src/api/session.h @@ -21,4 +21,14 @@ public: }
};
+class GetSessionRequest2 : public HttpRequest
+{
+public:
+ GetSessionRequest2() :
+ HttpRequest(REQUEST_GET, STEAM_WEB_URL)
+ {
+ flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMP;
+ }
+};
+
#endif //_STEAM_REQUEST_SESSION_H_
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index a063870600..f2d06b208d 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -262,6 +262,11 @@ void CSteamProto::OnAuthorizationSuccess(const JSONNode &node) new GetSessionRequest(token.c_str(), steamId.c_str(), cookie.c_str()), &CSteamProto::OnGotSession); + // We need to load homepage to get sessionid cookie + PushRequest( + new GetSessionRequest2(), + &CSteamProto::OnGotSession); + PushRequest( new LogonRequest(token.c_str()), &CSteamProto::OnLoggedOn); @@ -269,7 +274,7 @@ void CSteamProto::OnAuthorizationSuccess(const JSONNode &node) void CSteamProto::OnGotSession(const HttpResponse *response) { - if(!response) + if (!response) return; for (int i = 0; i < response->headersCount; i++) diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 8644f9fa50..8d70098aa0 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -325,7 +325,8 @@ int CSteamProto::SetStatus(int new_status) requestQueue->Start(); ptrA token(getStringA("TokenSecret")); - if (mir_strlen(token) > 0) + ptrA sessionId(getStringA("SessionID")); + if (mir_strlen(token) > 0 && mir_strlen(sessionId) > 0) { PushRequest( new LogonRequest(token), |