Log User out Not Working

Hello,

I am not having any success with the application showing the correct information for when a user is logged in or logged out.

I have gone so far as to log each user in and then log them out using my test data. Every time I tried to do this it failed to produce correct results for users who were logged out.

I decided to see if my logic was flawed and added a datafield to my user datatype of logged in and logged out. When I reference the datafields I created my logic and workflows work fine, so it seems that there is something wrong with the internal system of logging a user in or out and labeling the true false portion correctly as each time I logged a user out the user was logged out successfully however the internal boolean for is logged out did nothing.

Hello, could i see your workflow?
maybe you are confusing ‘log out’ with ‘log out other sessions’
I have done that before.
My log out action is working fine.

@anon65040322
The problem isn’t actually the log out portion. The user does get logged out correctly. I tested that and saw users being removed from the logged in repeating group.

However, the issue is that the user is not having their true/false datafield of user isn’t logged in ( and I am assuming the user is logged in value as well ) changed correctly. Unfortunately, that is a datafield that I assume is native in bubble as I am unable to locate or manipulate it.

So I don’t actually have a workflow that is able to change that to the appropriate settings on a user log out. The workflow I used for user logout is below.

When I use a repeating group to display the logged out users, I don’t have any as seen below:

When I set user isn’t logged in equals yes; nothing appears in my repeating groups. However, it will be removed from the repeating group of the user is logged in equals yes.


This is a default/bubble state. You dont need to create your own.

1 Like

Yeah thats what I figured, that it was a default bubble state…however it doesn’t seem to register users who are currently not logged in

This is my setup for filtering users. One shows it using my settings and the other the bubble default settings. (The Data Should be the same)

This is how it looks on display

Seems like bubble default is not logging the user out and saving the true false value correctly.

Below shows when I have logged all users out.

This is what it looks like after I sign in two different users

30%20AM

And then after I log out one of them

This is my workflow



And lastly the bubble default log in reusable element workflow

Seems to me like something isn’t working correctly that are default settings that I am unable to control in my app.

There’s your misunderstanding:

There IS NO LIST OF LOGGED IN USERS.

“is logged in” is a property of the “Current User” object. (Current User is a metaphor for “the entity viewing this page”.)

There is no “list of Current Users”. There may be 1000 entities viewing pages in your app. Each of them – to them, and to your app’s logic – is Current User.

If you want to add a notion of user presence to your app, you can do it, but it’s not a simple concept. @AliFarahat’s “Efactive” plugin is used by some to add active/idle/hidden presence detection and seems to be well regarded (I’ve not played with it myself).

Aside: If you want to understand user presence in general, this video from fireship.io is pretty awesome. The video itself is about coding a presence system using Angular and Firebase, but even if that makes no sense to you, the discussion of presence and the requirements there is really helpful:

1 Like

Thanks @keith

I will give the plugin a shot and see how it works for me. I used an exit intent plugin as well, but can’t seem to figure out how to test two users at the same time to judge how it works.

You can use two different browsers to test two different users. :slight_smile:

1 Like

Thanks, I probably wouldn’t have thought about that…took me reading online to attempt a different browser to test some HTML and still didn’t consider it for this.

The one issue with using Data to show whos online/offline is that when someone Clicks off the browser rather than Logging out (Which most people do) makes the Data “login/out” stay the same as it was before they clicked off. I would suggest using the “Out of browser” plugin or something along those lines where when the user goes above the HTML box it’ll popup a box saying that it’s better to logout rather than click off. But it’s all up to you

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