Make persistent login Instagram

HI, all

I have a app that uses intagram login API

I´d like to make a persitent Instagram login in my app.

The sequence would be:

User login in my app,
create a session for this user
if user closes the browser and open again, is not necessary login again.
but if user logout or clear cookie, is necessary login again

Does anyone have any suggestions for doing this?

Thanks in advance

To make the Instagram login persistent in your Bubble app, you need to store the user’s session and refresh their authentication when they return. When a user logs in, save their Instagram access token in your database and use Bubble’s built-in user authentication system to create a session. If the user closes and reopens the browser, check if their session is still active by looking for a valid token. If the token is present, automatically log them in without requiring them to enter their credentials again.

To prevent re-login after closing the browser but still require it after logout or clearing cookies, enable Bubble’s “Stay logged in” feature when users log in. This ensures their session remains active even after closing the app. Additionally, store the Instagram access token in local storage or a database field linked to the user. When they return, check if the token is still valid by making an API request to Instagram. If valid, continue the session; if expired, prompt them to log in again.

If the user logs out, clear their session by deleting the stored token and logging them out from Bubble. If they clear cookies, they will need to log in again since the session data will be lost. To improve security, implement token refresh handling by checking Instagram’s API documentation to see if their access token supports refresh mechanisms. Hope it helps!

Thanks a lot.

I´ll try this.

This topic was automatically closed after 70 days. New replies are no longer allowed.