Users online

Within the session object, I have a variable containing the users name.

I have a dialog where I attempt to iterate through the sessions via:-

For i As Integer = 0 To App.SessionCount - 1
  var userName as string = App.SessionAt(i).userName
  me.AddRow( userName)

When running via the IDE, I can see myself online. When I execute via Xojo cloud, I sometimes see no users. Other times, I see myself, but no other users. Other users only ever see themselves at best, no one some of the time.

I’m guessing this is possible and it’s something silly I’m missing?

Have you tried putting that object in the app class?

1 Like

Hi Jay,

I have tried that. I am still only seeing the myself.

Solved with the following:-

dim WSC as new WebSessionContext(app.SessionAt(i))

s = session(wsc.Session)

var userName as string = s.UserName


Andy. Nice work. You might want ot mark it as “solved” so the next guy who googles it can find your solution.