List of active sessions?

  • Thread starter Thread starter Marcio Kleemann
  • Start date Start date
M

Marcio Kleemann

Is there a way to get a list of the session id's for all currently active
sessions for the application?

Thanks
 
Hi,

not automatically, but you certainly could develop such for yourself and
quite easily (incrementing and decrementing data to application when
sessions start and end)
 
Private Sub btnSessions_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSessions.Click
Dim keys As NameObjectCollectionBase.KeysCollection = Session.Keys
Dim key As String
Dim sSessions As String
For Each key In keys
' key is the item's key
' Session[key] returns the item's value
sSessions &= key.ToString & " - " & Session(key).ToString &
vbCrLf
Next key '
If sSessions.Length = 0 Then
txtSessions.Text = "No Active Sessions"
Else
txtSessions.Text = sSessions
End If
End Sub
 
Back
Top