forked from YellowOrWhite/go-steam-mobileauth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsession_data.go
72 lines (69 loc) · 1.4 KB
/
session_data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package mobileauth
import (
"net/http"
"net/http/cookiejar"
"strconv"
)
type SessionData struct {
SessionID string
SteamLogin string
SteamLoginSecure string
WebCookie string
OAuthToken string
SteamID uint64
}
func (sd *SessionData) AddCookies(cookies *cookiejar.Jar) {
cookies.SetCookies(cookiePath, []*http.Cookie{
&http.Cookie{
Name: "mobileClientVersion",
Value: "0 (2.1.3)",
Path: "/",
Domain: ".steamcommunity.com",
},
&http.Cookie{
Name: "mobileClient",
Value: "android",
Path: "/",
Domain: ".steamcommunity.com",
},
&http.Cookie{
Name: "Steam_Language",
Value: "english",
Path: "/",
Domain: ".steamcommunity.com",
},
&http.Cookie{
Name: "steamid",
Value: strconv.FormatUint(sd.SteamID, 10),
Path: "/",
Domain: ".steamcommunity.com",
},
&http.Cookie{
Name: "steamLogin",
Value: sd.SteamLogin,
Path: "/",
Domain: ".steamcommunity.com",
HttpOnly: true,
},
&http.Cookie{
Name: "steamLoginSecure",
Value: sd.SteamLoginSecure,
Path: "/",
Domain: ".steamcommunity.com",
Secure: true,
HttpOnly: true,
},
&http.Cookie{
Name: "dob",
Value: "",
Path: "/",
Domain: ".steamcommunity.com",
},
&http.Cookie{
Name: "sessionid",
Value: sd.SessionID,
Path: "/",
Domain: ".steamcommunity.com",
},
})
}