Get online users

0
0

Hi Wisej Team,

I’m looking for a technique in order to get the online users in my Wisej app.

any idea?

Thanks

Orel.

  • You must to post comments
0
0

Hi again Orel,

Please have a look at Session documentation.

When the user closes the browser, or shuts down the computer, or loses power, or loses the connection, the result for Wisej is the same: it stops receiving keep-alive messages from the client. When that happens, the session expiration timer starts to tick and after the specified timeout (which is the value specified in Default.json or the default) times 2, Wisej drops the session and disposes all the associated object.

After closing the browser, Wisej will wait 2 x 120 seconds (if you didn’t change sessionTimeout on the json file). Then the application exits and session counter is decreased.

You can use the debugger or a logger like NLog to see what’s happening and when it’s happening.

  • You must to post comments
0
0

Hi Orel,

Authentication and online users are application concepts. So that’s up to your application to solve.
Neverthless Wisej can tell you how many sessions are active:
Snippet

Application.SessionCount

[Edit]

To help you keep track of users that didn’t logout but are no longer online (closed the browser, etc) you have the event

Snippet

Application.ApplicationExit
  • Orel Gabay
    Hi, I came across with few bugs: Application.ApplicationExit doe’s not firing after tab close/browser close and Application.SessionCount not updating
  • Luca (ITG)
    Can’t reproduce. Browsers don’t generate any event when closing the tab or the browser. You have to wait for the session to time out and be disposed. Which will happen at sessionTimeout * 2. That’s when the session is disposed and ApplicationExit fired. The Application.SessionTimeout in Wisej is a recoverable event – unlike in ASPNET where it cabnnot be recovered.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.