Skip to content

Commit

Permalink
fix: fail to login from session file
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Feb 21, 2021
1 parent 508b138 commit 60b3685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysjtu/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def cookies(self, new_cookie: CookieTypes):
bak_cookie = self._client.cookies
# noinspection PyTypeHints
self._client.cookies = new_cookie # type: ignore
self._secure_req(partial(self.get, consts.LOGIN_URL, validate_session=False)) # refresh JSESSION token
self._secure_req(partial(self.get, consts.LOGIN_URL, validate_session=False, headers=consts.HEADERS)) # refresh JSESSION token
if self.get(consts.HOME_URL, validate_session=False).url.full_path == "/xtgl/login_slogin.html": # type: ignore
self._client.cookies = bak_cookie
raise SessionException("Invalid cookies. You may skip this validation by setting _cookies")
Expand Down

0 comments on commit 60b3685

Please sign in to comment.