By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

Possible to read active session variables?

P: n/a
When users log into my website, they're given session variables:
Session("userid") = [whatever their name is]

Let's say I have 7 users logged in. Is there a way to somehow loop
through all the sessions and return all the values of Session("userid")
that are open?

Basically, if 7 users are logged in, I want to be able to see which ones
have sessions open.

--
[ Sugapablo ]
[ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
[ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Sugapablo,

Unfortunately, no, you cannot list all the values in all your sessions or
anything like that. But, you can get a count of sessions. Take a look
here. http://www.aspfaq.com/show.asp?id=2095 (and notice link at the
bottom).

Ray at work

"Sugapablo" <ru**@REMOVEsugapablo.com> wrote in message
news:pa****************************@REMOVEsugapabl o.com...
When users log into my website, they're given session variables:
Session("userid") = [whatever their name is]

Let's say I have 7 users logged in. Is there a way to somehow loop
through all the sessions and return all the values of Session("userid")
that are open?

Basically, if 7 users are logged in, I want to be able to see which ones
have sessions open.

--
[ ] [ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ] [ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

Jul 22 '05 #2

P: n/a
what you want to do is possible.."sort of" just complicated because you can
not loop through the sessions like that

you would basically need to (for each session) store the info in applciation
variables as well
(ideally the less info the better.. like the username and the last time they
accesses anything are about all you should store)

you'd also want to recycle it and only store like 50 or so users at any one
time

then you can grab that info anytime you like from the application variable

AGAIN.. very complicated.. yet so very simple once it is all working..
Very difficult to explain and if done right not a performance/memory
problem.

systems like aspprotect v7 do something liek this to allow you to view
information on who is logged in and also what page they accessed last
I have looked the code over a few times and though I basically see what is
going on it is pretty complicated to grasp

www.aspprotect.com

"Sugapablo" <ru**@REMOVEsugapablo.com> wrote in message
news:pa****************************@REMOVEsugapabl o.com...
When users log into my website, they're given session variables:
Session("userid") = [whatever their name is]

Let's say I have 7 users logged in. Is there a way to somehow loop
through all the sessions and return all the values of Session("userid")
that are open?

Basically, if 7 users are logged in, I want to be able to see which ones
have sessions open.

--
[
]
[ http://www.sugapablo.net <--personal | http://www.sugapablo.com
<--music ]
[ http://www.2ra.org <--political | http://www.subuse.net
<--discuss ]

Jul 22 '05 #3

P: n/a
ohh, and there are lots of other little issues I forgot to mention as well..
like removing users from the application variables as they log off or their
session ends

etc etc
"Kyle Peterson" <kp*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
what you want to do is possible.."sort of" just complicated because you
can not loop through the sessions like that

you would basically need to (for each session) store the info in
applciation variables as well
(ideally the less info the better.. like the username and the last time
they accesses anything are about all you should store)

you'd also want to recycle it and only store like 50 or so users at any
one time

then you can grab that info anytime you like from the application variable

AGAIN.. very complicated.. yet so very simple once it is all working..
Very difficult to explain and if done right not a performance/memory
problem.

systems like aspprotect v7 do something liek this to allow you to view
information on who is logged in and also what page they accessed last
I have looked the code over a few times and though I basically see what is
going on it is pretty complicated to grasp

www.aspprotect.com

"Sugapablo" <ru**@REMOVEsugapablo.com> wrote in message
news:pa****************************@REMOVEsugapabl o.com...
When users log into my website, they're given session variables:
Session("userid") = [whatever their name is]

Let's say I have 7 users logged in. Is there a way to somehow loop
through all the sessions and return all the values of Session("userid")
that are open?

Basically, if 7 users are logged in, I want to be able to see which ones
have sessions open.

--
[ ]
[ http://www.sugapablo.net <--personal | http://www.sugapablo.com
<--music ]
[ http://www.2ra.org <--political | http://www.subuse.net
<--discuss ]


Jul 22 '05 #4

P: n/a
Sugapablo wrote:
Let's say I have 7 users logged in. Is there a way to somehow
loop through all the sessions and return all the values of
Session("userid") that are open?


If you write your own session management architecture, yes.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.