473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Possible to read active session variables?

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
4 1698
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gervin | last post by:
That was the first question. BTW, I am using Windows 2000 Server. Second questions is how do I transfer session variables from one virtual website to another website. Currently I have session...
9
by: | last post by:
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be reading in online articles?
4
by: Bob Stearns | last post by:
Right now, I am attempting to see how many users are "signed on" to my system. Since this is, at best, rather tenuous in a WEB environment, I thought to read the active session variables and see...
2
by: Chris Hayes | last post by:
Is it possible to iterate through all the active sessions of an ASP.net application? I have this fancy user object (with all kinds of properties) that I set as a session level object on session...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
5
by: Oleg Ogurok | last post by:
Hi all, Is there a way to read other people's session variables? I understand it makes sense that session state is on per-user basis, but still... Is there a way to get a collection of all...
5
by: Gaetan | last post by:
I would like to guarantee that only one session at a time can request exclusive access to an object stored in Application. The ownership of the object must last throughout multiple HTTP requests. ...
9
by: Laurent Bugnion | last post by:
Hi, I am wondering what is the best way to find out which ASP.NET sessions are still active. Here is the reason: I have a custom control which can upload files. It saves the files in a folder...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.