Issues with Login Session and Guest-to-User Conversion in Bubble

I’m developing a social platform where users can interact with features such as photo exchange and matching. Non-members (guests) are allowed to access certain limited functionalities without signing up. However, I’ve been experiencing various login and signup issues in both test and live environments:

Problems

  1. Test Environment: Login Issue
    • After logging in, the app redirects users to the main page, but the login state isn’t maintained. Users appear logged out upon reaching the main page.
  2. Live Environment: Signup Issues
    • “Session expired” error: The error message reads, “Sorry, your login session has expired or changed. Please try again.”
    • “User needs to be logged in” error: Another error message occurs: “The user must be logged in to modify their credentials.”

Implementation Details

• Guest Login: Guests are automatically logged in with a randomly generated email (e.g., randomID@domain.com) and flagged with isGuest = yes in the User database.
• Guest accounts have a scheduled backend API workflow to deactivate them after 1 hour of inactivity (isActive = no).
• Signup Workflow: When a guest decides to sign up, the app updates the same User entry with the user’s email and password via Update Credentials. Additional fields like isGuest (set to no) and profile details are also updated.
• Login Workflow: Guests can log out and log in with their credentials to access full member functionalities. The workflow also cancels all guest-specific actions, logs the guest out, and logs the user in with the provided credentials.

Workflows

  1. Signup Workflow

    1. Validate user input (e.g., name, email, etc.).
    2. Update the guest User’s credentials with the new email and password.
    3. Cancel the guest’s deactivation schedule.
    4. Update isGuest to no and save additional profile information.
    5. Redirect the user to the previous page after a short pause.
  2. Login Workflow

    1. Cancel all photo exchange and match actions related to the guest.
    2. Log the guest out.
    3. Log the user in with the provided credentials.
    4. Create notifications for actions like resetting photo exchange links.
    5. Redirect the user to the previous page after a short pause.

Troubleshooting Steps Taken

  1. Checked privacy rules: The User data type privacy allows This User is Current User to view fields, and no custom rules block the data.
  2. Verified database entries: Guest accounts and member accounts are created as expected, with unique fields properly updated.
  3. Tested on mobile and desktop: Login issues are more frequent in desktop environments, though they occur in both.
  4. Reviewed workflow delays: Added Pause steps to ensure processes (like credential updates) complete before redirection.

Suspected Causes

  1. Session Management Issue:
    • The session might not properly transition from a guest session to a member session after credentials are updated, leading to errors like “Session expired” or the app incorrectly treating the user as logged out.
  2. Test Environment Behavior:
    • The login state may not persist properly in the test environment due to potential caching or Bubble’s handling of cookies during development.

Questions

  1. Is it expected behavior for login sessions to reset or not persist during page redirection?
  2. How can I ensure a seamless session transition when upgrading a guest to a fully logged-in user?
  3. Could this be related to how Bubble handles cookies or session tokens in the test/live environment?
  4. Are there best practices for managing guest-to-user conversion workflows in Bubble?

Any guidance or recommendations would be greatly appreciated. Thank you!

you should re-format your post so the text is not in code format…meaning the list of items is not in red and horizontally scrollable…for me personally I will not read this due to the fact I have to horizontally scroll.

1 Like

Thanks

Check main page doesn’t have a on page load action to log the user out. Add to the navigation action a condition to do so only when the user is logged in, as they may not actually get logged in using the provided credentials.

to update credentials they need to password you created for them since they need the password to change the email address or the password.

1 Like