473,984 Members | 5,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web - Accessing Current Sessions?

Is there a way to iterate through some kind of collection and access
session variables in current active sessions on the website?

For example, I'd like to add a feature to an administrative section of a
website that will show the admin a given session variable ("username"
for example) for every active session. Other info, like IP addresses of
users and whatnot, would also be useful. Can this be done? Where would
I find this information?
Regards,
David P. Donahue
dd******@ccs.ne u.edu
Nov 17 '05 #1
5 1729
Hi David,

The first thought that comes to mind is to implement a collection for each
attribute at your web application "applicatio n level". Those objects are
initialized along with your web application. So when users get logged in or
change session variables that you want to track you can at the same time
update your application level objects and that will persist the data for as
long as the web application is running.

"David P. Donahue" <dd******@ccs.n eu.edu> wrote in message
news:Oj******** *****@TK2MSFTNG P12.phx.gbl...
Is there a way to iterate through some kind of collection and access
session variables in current active sessions on the website?

For example, I'd like to add a feature to an administrative section of a
website that will show the admin a given session variable ("username" for
example) for every active session. Other info, like IP addresses of users
and whatnot, would also be useful. Can this be done? Where would I find
this information?
Regards,
David P. Donahue
dd******@ccs.ne u.edu

Nov 17 '05 #2
Hi,

I haven't heard of any property/method of the HttpApplication class for
this, what you can do is using the feature of asp.net for keep a session
info in a SQL server, using this environment you can query the tables and
get the info you need.

also try to do a google search, I bet you are not the first one with this
request.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"David P. Donahue" <dd******@ccs.n eu.edu> wrote in message
news:Oj******** *****@TK2MSFTNG P12.phx.gbl...
Is there a way to iterate through some kind of collection and access
session variables in current active sessions on the website?

For example, I'd like to add a feature to an administrative section of a
website that will show the admin a given session variable ("username" for
example) for every active session. Other info, like IP addresses of users
and whatnot, would also be useful. Can this be done? Where would I find
this information?
Regards,
David P. Donahue
dd******@ccs.ne u.edu

Nov 17 '05 #3
Check this tutorial on how you can use information at the application level,
it will allow you to persist data through the lifetime of the web
application so you can add/remove items from it as sessions are initialized
with user data:

http://samples.gotdotnet.com/quickst...lications.aspx

"David P. Donahue" <dd******@ccs.n eu.edu> wrote in message
news:Oj******** *****@TK2MSFTNG P12.phx.gbl...
Is there a way to iterate through some kind of collection and access
session variables in current active sessions on the website?

For example, I'd like to add a feature to an administrative section of a
website that will show the admin a given session variable ("username" for
example) for every active session. Other info, like IP addresses of users
and whatnot, would also be useful. Can this be done? Where would I find
this information?
Regards,
David P. Donahue
dd******@ccs.ne u.edu

Nov 17 '05 #4
Ya, I've been trying Google from time to time, and I've found some stuff
that kind of touches on the issue, but nothing that fits my needs.
Mostly 3rd party controls, which may or may not work in my environment
anyway.

I figured I could store the info in the database when sessions begin and
remove it when sessions end, but I was hoping to avoid any kind of I/O
if I could. The information is already in memory, I guess the .NET
libraries just don't have a way of getting to it. Having a Sessions
collection in the Application object would just be so damn useful :)
Regards,
David P. Donahue
dd******@ccs.ne u.edu

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

I haven't heard of any property/method of the HttpApplication class for
this, what you can do is using the feature of asp.net for keep a session
info in a SQL server, using this environment you can query the tables and
get the info you need.

also try to do a google search, I bet you are not the first one with this
request.

cheers,

Nov 17 '05 #5
Hi,

Just be careful with storing a reference to the Session in the application,
doing so may prevent those objects from be GCed

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"David P. Donahue" <dd******@ccs.n eu.edu> wrote in message
news:ur******** ******@TK2MSFTN GP10.phx.gbl...
Ya, I've been trying Google from time to time, and I've found some stuff
that kind of touches on the issue, but nothing that fits my needs. Mostly
3rd party controls, which may or may not work in my environment anyway.

I figured I could store the info in the database when sessions begin and
remove it when sessions end, but I was hoping to avoid any kind of I/O if
I could. The information is already in memory, I guess the .NET libraries
just don't have a way of getting to it. Having a Sessions collection in
the Application object would just be so damn useful :)
Regards,
David P. Donahue
dd******@ccs.ne u.edu

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

I haven't heard of any property/method of the HttpApplication class for
this, what you can do is using the feature of asp.net for keep a session
info in a SQL server, using this environment you can query the tables and
get the info you need.

also try to do a google search, I bet you are not the first one with this
request.

cheers,

Nov 17 '05 #6

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

Similar topics

4
1776
by: Antoni | last post by:
Hello, Could anyone advise, if I had three sessions as below, is there anyway I could access the three in a loop. $_SESSION; $_SESSION; $_SESSION; Thank you
8
3982
by: ndsoumah | last post by:
hello guys I'm trying to get access to variables I put in a session variable from another page and it fails... here's the exact situation main file page1.php
1
5824
by: Dax Westerman | last post by:
I have a site that I'm trying to migrate to ASP.NET from ASP, and the foremost stumbling block I'm hitting is session state between the ASP and ASP.NET applications. In order to access this information, I'm doing a HttpWebRequest from the ASP.NET side into an .asp page, passing the session name on the get in order to request it from the ASP side and write it back to the response stream, giving ASP.NET access to it. Of course I change...
3
2048
by: Alex | last post by:
I'm having a problem porting an ASP solution to ASPX. In the ASP solution I'm accessing a DCOM server, create sub DCOM objects and call functions from VB script on the ASP pages. The DCOM object handles are stored in session variables. This works fine without a problem. Ported it to ASPX, accessing the same DCOM server from code behind pages. Still, usually no problems. However sometimes I'm seeing an error stating that the DCOM handle...
15
1907
by: SFX | last post by:
If I have a session ID (string) can I somehow obtain the session object associated to that ID (it exist of course) ? I know this sounds wicked but I have a situation in which I have to make a request from the client (IE) but for security reasons I can not access the headers of the current request, so I can not make my new request contain the same session ID cookie. So I was thinking that if I pass the session ID as a parameter which I...
3
1359
by: niju | last post by:
Hi there, I have three web pages (A,B,C). I need to prevent users accessing page B and C without accessing A. What would be the best way to achieve this rule? Many Thanks Niju
0
897
by: Benny Hauk | last post by:
I'm trying to find a way to monitor all active sessions from a single, administrative page. It would be an administrative page for me to see the number of sessions, and the contents of those sessions for my app. I realize I could do some rewrite and keep some application variables that store things like number of current sessions and things like that, but I can't afford to hurt performance by having application variables being modified...
8
17277
by: Brendon Bezuidenhout | last post by:
Hey all, Newbie question I'm afraid: Is there a way to see/tell how many users are currently logged into a website at all? Thanks Brendon
2
1765
by: brendan_gallagher_2001 | last post by:
HI I am developog an ASP.net site (using vb.net 1.1) which will be accessed by a number of different office locations, where certain users will be assigned a authoriser profile, and others will be assigned a verifier profile. At least two authoriser, and multiple verifiers exist per office. I need to be able to prevent two users with the same profile, and from the same office location, accessing the same page at the same time. I
0
10372
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
11857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11448
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
11627
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
10934
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10106
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
8482
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...
1
5181
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
3
3786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.