Tuesday, March 27, 2012

List of active sessions?

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

ThanksHi,

not automatically, but you certainly could develop such for yourself and
quite easily (incrementing and decrementing data to application when
sessions start and end)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Marcio Kleemann" <notavailable> wrote in message
news:OMGCRqsXEHA.1144@.TK2MSFTNGP10.phx.gbl...
> Is there a way to get a list of the session id's for all currently active
> sessions for the application?
> Thanks
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
"Marcio Kleemann" <notavailable> wrote in message
news:OMGCRqsXEHA.1144@.TK2MSFTNGP10.phx.gbl...
> Is there a way to get a list of the session id's for all currently active
> sessions for the application?
> Thanks

0 comments:

Post a Comment