473,748 Members | 7,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying all logged on users

Hello All,

I would like to display all logged on users on a web
page. I store each user's name in a session varible, but
I don't seem to be able to loop through a sessions
collection to view all sessions. Has anyone else figured
this out?

Thanks in advance,
Vince
Nov 17 '05 #1
8 1858
When the user logs in you should put their user name into a global
collection or array or similar structure.
When the Session_End event fires (in your global.asax) remove the name.
This should give you roughly the functionality you described.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------

"Vince Varallo" <vv******@hotma il.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Hello All,

I would like to display all logged on users on a web
page. I store each user's name in a session varible, but
I don't seem to be able to loop through a sessions
collection to view all sessions. Has anyone else figured
this out?

Thanks in advance,
Vince

Nov 17 '05 #2
Great idea, thanks
-----Original Message-----
When the user logs in you should put their user name into a globalcollection or array or similar structure.
When the Session_End event fires (in your global.asax) remove the name.This should give you roughly the functionality you described.
--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:http://www.able-consulting.com
--------------------------------

"Vince Varallo" <vv******@hotma il.com> wrote in message
news:07******* *************** ******@phx.gbl. ..
Hello All,

I would like to display all logged on users on a web
page. I store each user's name in a session varible, but I don't seem to be able to loop through a sessions
collection to view all sessions. Has anyone else figured this out?

Thanks in advance,
Vince

.

Nov 17 '05 #3
Well that's an easy enough situation to handle.
Just check before you insert the user into your collection and make sure
they're not already in there. If they're already in there then simply don't
add them again.
But I bet Vince was smart enough to figure that one out by himself.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------
"Jerry III" <je******@hotma il.com> wrote in message
news:uj******** ******@TK2MSFTN GP10.phx.gbl...
Up to the point when one user logs in twice and logs out ;) Think about what will happen.

Jerry

"Vince Varallo" <vv******@hotma il.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Great idea, thanks
-----Original Message-----
When the user logs in you should put their user name

into a global
collection or array or similar structure.
When the Session_End event fires (in your global.asax)

remove the name.
This should give you roughly the functionality you

described.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done

right:
http://www.able-consulting.com
--------------------------------

"Vince Varallo" <vv******@hotma il.com> wrote in message
news:07******* *************** ******@phx.gbl. ..
> Hello All,
>
> I would like to display all logged on users on a web
> page. I store each user's name in a session varible,

but
> I don't seem to be able to loop through a sessions
> collection to view all sessions. Has anyone else

figured
> this out?
>
> Thanks in advance,
> Vince
.


Nov 17 '05 #4
Jerry, no need to get uncivilized.
Did you want me to write the code for him?
As I said in my original post "This should give you ROUGHLY the
functionality you described"
I'm well aware there are gotchas with any programming task.
The error you described would not necessarily happen. It all depends on
Vince's specific implementation.
Assuming it is only valid for one person to be logged on once at one time,
then it isn't valid for the person to be logged in twice, therefore the
second login must be due to time-out issues and should be ignored as I
suggested in my last post. This would fix the bug.
But who knows, maybe he wants a person to be able to be logged in from two
different places at once and then your potential bug would come into play.
At any rate, let's assume Vince is smart enough to design his own
application. He merely needed a jump start. If Vince has any further
problems such as the potential bug you described or other potential bugs, he
can post again and ask for more help.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------

"Jerry III" <je******@hotma il.com> wrote in message
news:em******** ******@TK2MSFTN GP12.phx.gbl...
Steve, I thought you were a little bit smarter. Your "solution" will still
not work, when a user logs in twice and then logs out the first session your solution will not show him/her as logged in anymore. To fix this you'd have to keep a session count for each logged in user and increase it with each
login and decrease it with each logout (and delete the user from your table when the count reaches zero to conserve memory).

It's ironic that you're putting your title in all your messages yet you're
not capable of some basic thinking. Vince might be smart enough to figure
out a solution but you're not.

Jerry

"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:uG******** ******@TK2MSFTN GP10.phx.gbl...
Well that's an easy enough situation to handle.
Just check before you insert the user into your collection and make sure
they're not already in there. If they're already in there then simply

don't
add them again.
But I bet Vince was smart enough to figure that one out by himself.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------
"Jerry III" <je******@hotma il.com> wrote in message
news:uj******** ******@TK2MSFTN GP10.phx.gbl...
Up to the point when one user logs in twice and logs out ;) Think
about what
will happen.

Jerry

"Vince Varallo" <vv******@hotma il.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
> Great idea, thanks
>
> >-----Original Message-----
> >When the user logs in you should put their user name
> into a global
> >collection or array or similar structure.
> >When the Session_End event fires (in your global.asax)
> remove the name.
> >This should give you roughly the functionality you
> described.
> >
> >--
> >I hope this helps,
> >Steve C. Orr, MCSD
> >http://Steve.Orr.net
> >--------------------------------
> >Hire top notch developers to get your projects done
> right:
> >http://www.able-consulting.com
> >--------------------------------
> >
> >
> >
> >"Vince Varallo" <vv******@hotma il.com> wrote in message
> >news:07******* *************** ******@phx.gbl. ..
> >> Hello All,
> >>
> >> I would like to display all logged on users on a web
> >> page. I store each user's name in a session varible,
> but
> >> I don't seem to be able to loop through a sessions
> >> collection to view all sessions. Has anyone else
> figured
> >> this out?
> >>
> >> Thanks in advance,
> >> Vince
> >
> >
> >.
> >



Nov 17 '05 #5
Well, if you go back in the thread you'll see my point. You suggested a
solution and I pointed out that there's a catch. So you offered a solution
to the catch that was NOT a solution to the catch. If you kept quiet or
offered a working solution I wouldn't have said anything.

Jerry

"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:uZ******** ******@TK2MSFTN GP09.phx.gbl...
Jerry, no need to get uncivilized.
Did you want me to write the code for him?
As I said in my original post "This should give you ROUGHLY the
functionality you described"
I'm well aware there are gotchas with any programming task.
The error you described would not necessarily happen. It all depends on
Vince's specific implementation.
Assuming it is only valid for one person to be logged on once at one time,
then it isn't valid for the person to be logged in twice, therefore the
second login must be due to time-out issues and should be ignored as I
suggested in my last post. This would fix the bug.
But who knows, maybe he wants a person to be able to be logged in from two
different places at once and then your potential bug would come into play.
At any rate, let's assume Vince is smart enough to design his own
application. He merely needed a jump start. If Vince has any further
problems such as the potential bug you described or other potential bugs, he can post again and ask for more help.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------

Nov 17 '05 #6
There are many possible solutions to the rare "bug" you mentioned, which
would likely have mild consequences anyway.
I'd list them all out for you but nobody asked me to so I won't bother.

The guy posted a simple question, and I posted a simple answer. He was
satisfied with the answer and, as far as we know, lived happily ever after.
I don't know why you've bothered to overcomplicate the situation.

If you're as smart as you like to imply then this newsgroup would benefit
from you posting solutions instead of criticisms.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Jerry III" <je******@hotma il.com> wrote in message
news:uf******** ******@TK2MSFTN GP09.phx.gbl...
Well, if you go back in the thread you'll see my point. You suggested a
solution and I pointed out that there's a catch. So you offered a solution
to the catch that was NOT a solution to the catch. If you kept quiet or
offered a working solution I wouldn't have said anything.

Jerry

"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:uZ******** ******@TK2MSFTN GP09.phx.gbl...
Jerry, no need to get uncivilized.
Did you want me to write the code for him?
As I said in my original post "This should give you ROUGHLY the
functionality you described"
I'm well aware there are gotchas with any programming task.
The error you described would not necessarily happen. It all depends on
Vince's specific implementation.
Assuming it is only valid for one person to be logged on once at one time, then it isn't valid for the person to be logged in twice, therefore the
second login must be due to time-out issues and should be ignored as I
suggested in my last post. This would fix the bug.
But who knows, maybe he wants a person to be able to be logged in from two different places at once and then your potential bug would come into play. At any rate, let's assume Vince is smart enough to design his own
application. He merely needed a jump start. If Vince has any further
problems such as the potential bug you described or other potential
bugs, he
can post again and ask for more help.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------


Nov 17 '05 #7
I had no intention to overcomplicate the issue, that's why I posted a hint
on what to think about if he implements the code (whether he chooses to
handle that situation or not was left up to him). You went into detail and I
thought it would be useful to the readers to point out that your suggestion
was unusable and was not fixing an issue you claimed it was fixing. Had you
posted an algorithm that was valid and working (or not posted any at all) it
would have ended then. I just think it was valuable to point out that the
solution posted was not doing what you were claiming. It has nothing to do
with you or with this particular issue, I think it's good to point out that
code/algorithm/solution posted is not valid/correct/working. If I posted a
bogus code I would appreciate someone noticing and letting us know.

Jerry

"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:%2******** **********@tk2m sftngp13.phx.gb l...
There are many possible solutions to the rare "bug" you mentioned, which
would likely have mild consequences anyway.
I'd list them all out for you but nobody asked me to so I won't bother.

The guy posted a simple question, and I posted a simple answer. He was
satisfied with the answer and, as far as we know, lived happily ever after. I don't know why you've bothered to overcomplicate the situation.

If you're as smart as you like to imply then this newsgroup would benefit
from you posting solutions instead of criticisms.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Jerry III" <je******@hotma il.com> wrote in message
news:uf******** ******@TK2MSFTN GP09.phx.gbl...
Well, if you go back in the thread you'll see my point. You suggested a
solution and I pointed out that there's a catch. So you offered a solution
to the catch that was NOT a solution to the catch. If you kept quiet or
offered a working solution I wouldn't have said anything.

Jerry

"Steve C. Orr, MCSD" <St***@Orr.ne t> wrote in message
news:uZ******** ******@TK2MSFTN GP09.phx.gbl...
Jerry, no need to get uncivilized.
Did you want me to write the code for him?
As I said in my original post "This should give you ROUGHLY the
functionality you described"
I'm well aware there are gotchas with any programming task.
The error you described would not necessarily happen. It all depends on Vince's specific implementation.
Assuming it is only valid for one person to be logged on once at one

time, then it isn't valid for the person to be logged in twice, therefore the second login must be due to time-out issues and should be ignored as I
suggested in my last post. This would fix the bug.
But who knows, maybe he wants a person to be able to be logged in from two different places at once and then your potential bug would come into play. At any rate, let's assume Vince is smart enough to design his own
application. He merely needed a jump start. If Vince has any further
problems such as the potential bug you described or other potential

bugs,
he
can post again and ask for more help.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
--------------------------------
Hire top notch developers to get your projects done right:
http://www.able-consulting.com
--------------------------------



Nov 17 '05 #8
The reason for this is security. If you can get the list of active sessions
nothing stops you from impersonating any one of them. I hope that if anyone
ever implements this functionality they will let their users know that
anybody can pretend to be them.

Jerry

"steve" <st***********@ zz99.com> wrote in message
news:26******** *************** *****@phx.gbl.. .
I think the original question was whether the sessions
can be enumerated. The sessions CANNOT be enumerated. We
have to write additional code for Global.Session_ Start and
Global.Session_ End to maintain a list of active sessions.

The ASP.NET session state has three good implementations
for saving state; the problem is that even these three do
not work for everyone, but the overall design is closed
and not extensible by any documented means. Many hours
will be expended by those of us who must code around these
limitations.

Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2710
by: Leszek | last post by:
Hi everybody, I need your help-I want to display all users which are online on my web page and I don't know how to do this. I know how to do this whit one IP but for more - I don't. HELP ME :o( PS: I don't have mySQL so it should be whit file. Leszek
12
2524
by: Dave Smithz | last post by:
Hi there, Users of my PHP DB application have complained that it seems to log them out every now and then. I actually assume this is when it has been idle for sometime as I use session variables to store a logged in token. With only basic knowledge of sessions I assumed there was some kind of default time before the session data is destroyed. Is this the case?
8
1687
by: gil | last post by:
I'm trying to track how many users are visiting a site and how may are logged in, using application sessions like so: Sub Session_OnStart Session.Timeout = 20 Session("Start") = Now Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 Application.UnLock End Sub
8
3240
by: Mike Thomas | last post by:
I have two clients now who want to have an Access 2000 & 2002 application running on NT Server 2000 do some file updating at night when nobody is in the office. I have used Windows scheduler to schedule the apps to start at 4:00 am, but at that time of night, nobody is logged on to the server. Is it possible to get Access to run on a server when nobody is logged on? Many thaks Mike Thomas
2
1234
by: MS | last post by:
A 97 What's a quick way of determining who's using a FE/BE database at any given time? I'd like to display this info on the main form. I've tried reading the .ldb file and putting the results in a text box or label, but as users "log off" the .ldb file doesn't seem to reflect the fact a user has left, though it does correctly display users who join.
6
4598
by: John Dalberg | last post by:
I want to automate the process of logging into an intranet. I want to pull out the username of the Windows user logged into the machine running the browser and use the username in my app. How can I get the logged in username? Do I have to disable the anonymous access in IIS? I rather not because the site is running under a certain domain user which has access to certain folder and network shares and the site needs thsi access for reading...
20
4491
by: Tim Reynolds | last post by:
Team, I am developing a web service. In testing in on my enw PC, I am expecting to see exceptions thrown appear on my browser. Instead I am getting an HTTP 500 Internal Server Error page and I am not seeing my exception details. The web.config file being used has the setting <customErrors mode="Off"/>. This should allow me to see the detailed exception info. On a different computer - same code - same web config - the exception details...
8
3747
by: Mike P | last post by:
What would be the best way of counting the number of users who are currently logged on to a website? I am making the users login against a database of valid users. Would the best way be to add a bool field to the table and set each user to 1 if they are logged in, and 0 if they are not logged in? *** Sent via Developersdex http://www.developersdex.com ***
13
6756
by: snowinfo | last post by:
Hi all, any way to count the number of users i have logged into my site? any help/code appreciated, craig
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.