@@ -9,11 +9,12 @@ import (
99
1010// Credential contains required information which 115 server uses to
1111// authenticate a signed-in user.
12- // In detail, three cookies are required: "UID", "CID", "SEID ", caller can
13- // find them from browser cookie storage.
12+ // In detail, these cookies are required: "UID", "CID", "KID ", "SEID".
13+ // Caller can find them from browser cookie storage.
1414type Credential struct {
1515 UID string
1616 CID string
17+ KID string
1718 SEID string
1819}
1920
@@ -34,6 +35,9 @@ func (a *Agent) CredentialImport(cr *Credential) (err error) {
3435 protocol .CookieNameCID : cr .CID ,
3536 protocol .CookieNameSEID : cr .SEID ,
3637 }
38+ if cr .KID != "" {
39+ cookies [protocol .CookieNameKID ] = cr .KID
40+ }
3741 a .llc .ImportCookies (cookies , protocol .CookieDomains ... )
3842 return a .afterSignIn (cr .UID )
3943}
@@ -43,6 +47,7 @@ func (a *Agent) CredentialExport(cr *Credential) {
4347 cookies := a .llc .ExportCookies (protocol .CookieUrl )
4448 cr .UID = cookies [protocol .CookieNameUID ]
4549 cr .CID = cookies [protocol .CookieNameCID ]
50+ cr .KID = cookies [protocol .CookieNameKID ]
4651 cr .SEID = cookies [protocol .CookieNameSEID ]
4752}
4853
0 commit comments