diezo / Ensta

🔥 Fast & Reliable Python Package For Instagram API - 2024
https://bit.ly/ensta-discord
MIT License
371 stars 44 forks source link

Sessions in other devices end unexpectedly. #54

Closed juanep97 closed 10 months ago

juanep97 commented 10 months ago

Logging using Host(username,password) causes sessions in other devices such as a phone or the browser to end unexpectedly.

diezo commented 10 months ago

i've logged in using ensta a lot but never encountered such problems.

are you sure this happens every time or once in a while? maybe those sessions were already about to expire and not a fault of ensta.

juanep97 commented 10 months ago

I'm quite sure it was because of ensta, and it happens every time. Might have something to do with a maximum number of sessions and that ensta doesn't reuse sessions?

diezo commented 10 months ago

ensta does reuse sessions. it stores the session data in ensta-session.txt file. do you have persistent storage enabled on the backend? maybe your backend doesn't allow persistent storage?

also, do you get emails everytime you run the script depicting a new login?

juanep97 commented 10 months ago

Ok, I think what was happening is that I was using 2 accounts, so every time I used account A and then account B, on the same script, the ensta-session.txt was replaced, and it had to log-in again in A. I solved this passing a file="ensta-session-{username}.txt" to Host so sessions for different users did not overwrite. Maybe add a comment in the documentation, or add several sessions in the ensta-session.txt file by default?

diezo commented 10 months ago

glad your issue is fixed. i'll tweak the code in future releases so that ensta creates a seperate file for each username and not overwrite the same file repeatedly.

thanks for the suggestion.