Displaying all logged on users

V

Vince Varallo

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
 
S

Steve C. Orr, MCSD

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.
 
V

Vince Varallo

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
--------------------------------






.
 
S

Steve C. Orr, MCSD

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.
 
S

Steve C. Orr, MCSD

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.
 
J

Jerry III

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
 
S

Steve C. Orr, MCSD

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 said:
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 said:
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,
 
J

Jerry III

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 said:
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.
 
J

Jerry III

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top