Session State For All Active Sessions: Who is logged on?

 I want to check and see who is logged on.  What are some ways I can access every single session state?

I.E.

ActiveSession 1:
Session["ScreenName"] = Joe;
ActiveSession 2:
Session["ScreenName"] = Jane;
ActiveSession 3:
Session["ScreenName"] = John;
ActiveSession 4:
Session["ScreenName"] = James;

-------------
Need to be able to do something like (doesn't have to be exactly like this):

string AllSessions = RetrieveAllSessionsFromServer("ScreenName");
AllSessions = [Joe, Jane, John, James];

 

Thanks! 

0
SolidSilicon
4/14/2008 8:39:16 AM
asp.net.state-management 8807 articles. 0 followers. Follow

5 Replies
942 Views

Similar Articles

[PageSpeed] 5
Get it on Google Play
Get it on Apple App Store

I don't know the answer, but 

I usually use database to store this actually.  You can have a table let's say "Online", with columns "ScreenName", "LoginTime", etc. as you like.

Why not do like this way? 


Learning while training...
Personal Website: http://www.mleader.net
0
mleader1
4/14/2008 11:43:38 AM

Hi,

Here's a similar thread where i gave some pointers. Check it out

http://forums.asp.net/p/1231756/2224839.aspx

HTH,
Suprotim Agarwal


ASP.NET Grid With Excel Capabilities | 27 GridView Tips & Tricks | Hosting your site? | SQL Server Tips
0
Suprotim
4/14/2008 12:17:53 PM

1. Open the Command Prompt on your web server
2. Type perfmon.msc
3. Right Click the RIGHT PANEL and choose add counters
4. Select Web Service in the Performance Object dropdown
5. Try adding some counters and see what you can find out
6. Let us know how it goes

-Allan


Allan Horwitz
0
allanhorwitz
4/14/2008 3:08:28 PM

Hi!
Try this:

sitemaster.vb

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
  
nvcOnEveryRequest()
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
If IsPostBack() = False Then
      Dim nvc As NameValueCollection = Application("nvc")
     
If IsNothing(nvc) Then
        
nvc = New NameValueCollection
     
End If
     
Application("nvc") = nvc
  
End If
End Sub

Sub nvcOnEveryRequest()
  
If Not IsNothing(Session("PlayerID")) Then
     
Dim nvc As NameValueCollection = Application("nvc")
     
If IsNothing(nvc) Then
        
nvc = New NameValueCollection
     
End If
     
nvc(Session("PlayerID").ToString) = Now
     
Application("nvc") = nvc
  
End If
  
nvcRefresh()
End Sub

Sub nvcRefresh()
  
Dim nvc As NameValueCollection = Application("nvc")
  
If Not IsNothing(nvc) Then
     
Dim i As Integer
     
If nvc.Count > 0 Then
        
Dim myArrList As New ArrayList
        
For i = 0 To nvc.Count - 1
           
If CDate(nvc.Get(i)) < Now.AddMinutes(-10) Then
              
myArrList.Add(nvc.GetKey(i))
           
End If
        
Next i
        
For Each Name As String In myArrList
            nvc.Remove(Name)
        
Next
        
Application("nvc") = nvc
     
End If
  
End If
End Sub

 

In an other site you could walk through the nvc and load the data from db with the ID.
You could change the minutes from -10 to where you want. The most problem is that you dont know when the user is gone. Maybe he startet a new page on the browser and for example the session is still alive.
But with that every user click refreshes and cleans the nvc.

Please try and let me know! :-)

0
Stefan
4/14/2008 3:34:33 PM

So, there really isn't a (simple) way to access multiple sessions is there w/o having to create a brand new user tracking system?   

0
SolidSilicon
4/20/2008 1:39:03 PM
Reply:

Similar Artilces:

The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increas
Hi.. I am making a mobile application using .net framework 2.0. My Application has  web farm scenario so for state management  I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit."   &...

"The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increa
Hi.. I am making a mobile application using .net framework 2.0. My Application has web farm scenario so for state management I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit." I am not getting why this error is coming ..Though I already h...

Unable to make the session state request to the session state server.
 Hello,           I’m receiving this error when I put my website on production."Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before men...

Unable to make the session state request to the session state server
Hi all, I'm working on the website http://universityauction.net and I was using session variables using InProc session mode to manage session state. This worked fine until I put the website in a load balanced environment, as inproc sessions get lost when jumping from server to server. I decided to move to a state server mode, so I changed my web.config to: <sessionState             mode="StateServer"             stateConnectionString="tcpip=123.456.7.8:42424"      ...

Error: Unable to make the session state request to the session state server
I have session configured in web.config this way:<sessionState mode="StateServer" cookieless="true", timeout="30" stateConnectionString="tcpip=127.0.0.1:42424" />  ASP.NET State Service is started.   I got an error:  Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentContr...

Unable to make the session state request to the session state server etc.
We are getting an error message "Unable to make the session state request to the session state server..." sporadically in one of our applications.  We have several applications running on a 4-server web farm, and these applications have been in production for a year, so it is not a problem that the server is not reachable, not started, not addressed correctly, etc etc etc. One of the applications *does* put a lot of large datasets into session state.  Is there a limit on the allowable size of a session/cached object?  Also, the application opens several windows at once, ...

Unable to make the session state request to the session state server #2
We have recently started receiving these errors in the event viewer. We are using the out of proc state server on the same machine. The errors become more frequent, almost like it snowballs until users cannot work. System Info: Windows Server 2003 Standard SP2 , 4 GB of RAM, IIS 6.0, Asp.Net 2.0. What I know for certain: The state server is started and running Recycling the app pool nor restarting IIS fixes the problem Rebooting the machine DOES temporarily fix the problem. I changed the stateNetworkTimeout from 10 to 20 in webconfig and that had no effect. There is usuall...

Unable to make the session state request to the session state server
 We have a web application in our school called CHECM. We are experiencing a high volume of ASP.NET State Server errors throughout this month. These errors have been occurring since 7/11/2006.   Our Session State Mode has been --------------------------------------------------------- <sessionState mode="StateServer" stateConnectionString="tcpip=CHECM:42424" timeout="20" stateNetworkTimeout="30"/>     Here is the Error we get randomly Exception: System.Web.HttpException Message: Unable to make the session state request to the session state server. P...

Visual Studio 2005
 Hi, I have recently been given a PC with Vista on it, and installed Visual Studio 2005 pro. I then moved a ASP.net web project from an XP machine to the Vista one. When I run the project from inside Visual Studio (debug mode) everything works fine on the front end of the website, but if I try and log in I get the following error:  Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that i...

Error message
Hello,I have developed an ASP.NET c# application.I have a "Reports" page in which i put the the report's DataTable in a session (to use it later on for paging and sorting).This works on my localhost but on production I get the follwong error:Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic...

Session State and View State
Hi Everyone, Can anybody tellme how are these used in context with ASP.NeT whats their sole purpose?.....and where in programming we use  them? Any links or sources would be good which explains in simple terms.   thanks Simi  ThanksSimi------------&------------"To learn to succeed, you must first learn to fail." -Michael Jordan Here is one of the discussion http://forums.asp.net/t/1145838.aspxMPI never desire to converse with a man who has written more than he hasread. -Samuel Johnson, lexicographer (1709-1784)  Hi There is a video tutorial a...

Unable to use session state server....requires session state server version 2.0 or above.
So, I have Windows 2003 IIS latest service packs running. Its running .NET 2.0 and .NET 1.1 applications in seperate application pools. Just today I applied the following patch to the server. (The server is not running any 3.0 or 3.5 applications or application pools)  Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86 Microsoft .NET Framework 3.5 Service Pack 1 is a full cumulative update that contains many new features building incrementally upon .NET Framework 2.0, 3.0, 3.5, and includes cumulative servicing upda...

Usage scenarios for view state, session state, application state, cookies
Hi Guys, Im a college student in London with exams starting Monday on ASP.NET with C#.  Id be so grateful if you could provide me with solid real world scenarios/examples of when you would use the following to maintain state and why you would use them in that instance:   View State Session State Application State Cookies Also when would you use SOAP instead of the REST architecture and vice versa and why - again real world usage scenarios?  I note Amazon's web service uses the REST architecture - why is this, why dont they use SOAP. Id be grateful for a timely respon...

Good news for those of you who get "Unable to make the session state request to the session state server." error..
Dear all,Due to the known problem of session variables getting lost if using InProc-server during frequent changes in development, I had to choose between SQL and ASP.NET State server, so I opted for the second. Initially, all fine, but after using it for a few days, I started to get this error: Server Error in '/cv2' Application.Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accep...

Web resources about - Session State For All Active Sessions: Who is logged on? - asp.net.state-management

Resources last updated: 1/12/2016 2:58:02 AM