Is refreshing session in the API example correct? #1618
Replies: 3 comments 17 replies
-
Yes, calling agent.login() always creates a new session, i.e. you should only call agent.resumeSession() if you have a valid session. |
Beta Was this translation helpful? Give feedback.
-
yes, just call login once. than resume. but at the moment, resume counts as create as well as login. so you won't win any request by using resumeSession instead of login method. at least atm. |
Beta Was this translation helpful? Give feedback.
-
The example in the package README was not intended to show that one of the We will update the example to be clearer. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
The example of the API looks like this.
I struggle to understand it. Doesn't it mean that the login will be attempted anyway (and crash from rate limit), regardless if I have saved session data?
Should it be resume session first if you have it? If it throws an exception - attempt login.
In my app I used to just login, but since today I hit rate limit whenever I restart the app during quick development, so I am looking on how to resume the session correctly.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions