Closed claell closed 7 months ago
That's not the case. Ensta auto-saves login sessions inside ensta-sessions
directory by default while using the Mobile class. Whenever you create a new instance of Mobile()
, it'll load the saved session rather than creating a new one until the saved session expires.
Ah, perfect, then I wasn't familiar with the details.
Is there a way to control this? For example, only one time giving explicit credentials, and then just normally instantiating without credentials until the session expired?
Mobile
class will calculate the hash of username and password and find it's corresponding session file. Then, it'll use that session until it expires. The credentials will only be used to verify the saved session files and will be used to create new sessions when the existing ones expire.
If you don't wish to explicitly provide your credentials and rather use a saved session, you can do so by passing the contents of the session file as a string to Mobile
class's session_data
parameter. Hope that helps.
Persisting login information might be a good idea. Otherwise, the account appears to be signed in from scratch for every new creation of the
Mobile()
class, right?