473,406 Members | 2,356 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,406 software developers and data experts.

Is it possible to enumerate sessions for an application?

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.

However the session might timeout.

When a session ask ownership of the object, I need to determine whether the session that
currently own it is still active. I need to enumerate the sessions for the current
application to determine whether to previously assigned ownership is still valid.

Hence my question: Is it possible to enumerate sessions for an application?
Nov 19 '05 #1
5 3848
In the event it is not possible to enumerate the active sessions, is there a mechanism in
IIS 6 where I can query whether a given SessionID is valid?

On Fri, 21 Oct 2005 20:55:20 GMT, Gaetan <so*****@somewhere.com> wrote:
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.

However the session might timeout.

When a session ask ownership of the object, I need to determine whether the session that
currently own it is still active. I need to enumerate the sessions for the current
application to determine whether to previously assigned ownership is still valid.

Hence my question: Is it possible to enumerate sessions for an application?

Nov 19 '05 #2
the common approach is to track sessions is to keep a hashtable of sessions,
add on seassionstart, remove on sessionend.

-- bruce (sqlwork.com)
"Gaetan" <so*****@somewhere.com> wrote in message
news:4s********************************@4ax.com...
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.

However the session might timeout.

When a session ask ownership of the object, I need to determine whether
the session that
currently own it is still active. I need to enumerate the sessions for the
current
application to determine whether to previously assigned ownership is still
valid.

Hence my question: Is it possible to enumerate sessions for an
application?

Nov 19 '05 #3
That would be a logical approach but many articles on MSDN and even in this newsgroup
suggest that Session_End() is not always invoked when a session ends.
On Fri, 21 Oct 2005 16:39:02 -0700, "Bruce Barker" <br******************@safeco.com>
wrote:
the common approach is to track sessions is to keep a hashtable of sessions,
add on seassionstart, remove on sessionend.

-- bruce (sqlwork.com)
"Gaetan" <so*****@somewhere.com> wrote in message
news:4s********************************@4ax.com.. .
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.

However the session might timeout.

When a session ask ownership of the object, I need to determine whether
the session that
currently own it is still active. I need to enumerate the sessions for the
current
application to determine whether to previously assigned ownership is still
valid.

Hence my question: Is it possible to enumerate sessions for an
application?

Nov 19 '05 #4
If you are talking only about enumeration
NameObjectCollectionBase.KeysCollection keys = Session.Keys;
foreach (string key in keys)
{
// Session[key] returns the item's value
}

Now if you need to track whether the sessions are active or not you
have to think of some cryptic logic. This what i had done for a chat
application. I pinged the server in regulare intervals and in every
ping i updated the time. So if the time intervals are minimum that
means that session is active or else its not. For web based application
you can make a small hidden fram and trip the server in regulare
intervals.....I know it will increase traffic ... Any more suggestion i
would like to track this thread
-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Nov 19 '05 #5
What I am trying to achieve here is to obtain the list of SessionID for the application;
not the keys that have been defined in my own session.

If there are 5 connected users wo my web site, I would like to obtain the 5 SessionID
values.

On 21 Oct 2005 21:26:25 -0700, sh**********@yahoo.com wrote:
If you are talking only about enumeration
NameObjectCollectionBase.KeysCollection keys = Session.Keys;
foreach (string key in keys)
{
// Session[key] returns the item's value
}

Now if you need to track whether the sessions are active or not you
have to think of some cryptic logic. This what i had done for a chat
application. I pinged the server in regulare intervals and in every
ping i updated the time. So if the time intervals are minimum that
means that session is active or else its not. For web based application
you can make a small hidden fram and trip the server in regulare
intervals.....I know it will increase traffic ... Any more suggestion i
would like to track this thread
-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Nov 19 '05 #6

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

Similar topics

4
by: Sugapablo | last post by:
When users log into my website, they're given session variables: Session("userid") = Let's say I have 7 users logged in. Is there a way to somehow loop through all the sessions and return all...
2
by: Arsen Vladimirskiy | last post by:
Hello, Is there a way to enumerate (or iterate through) all the current sessions of an ASP.NET application? For example, I want to write a file current-session.aspx that will tell me the...
2
by: Moses M | last post by:
I am new to C#! I need to enumerate TS sessions (including sessions running in non-application mode) using a C# application. Can this be done using a "TS-WMI" provider? Any input will be...
6
by: Rich Crusco via DotNetMonster.com | last post by:
I am looking for a way to convert the following vbs script to c# Const ADS_SECURE_AUTHENTICATION = 1 strADMIN = "adminaccount" strPASSWORD = "password" strUSER = "useraccount" Set dso =...
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...
2
by: Steve Franks | last post by:
According to the docs you tell ASP.NET to use cookieless sessions by setting a value in the config.web file. However, what if I wanted to determine at run time whether or not I wanted to use...
12
by: D. Shane Fowlkes | last post by:
This is a repost (pasted below). Since my original post, I've double checked the system clock and set all IIS Session Timeout values to 10 minutes. Still ...the problem occurs. I've also...
5
by: HL | last post by:
Hi, I need to enumerate windows and find the sum of the rect of all the windows of a specific application. In C++, I use the APIs - 'EnumWindows , GetWindowRect and UnionRect to accomplish the...
6
by: Dylan Nicholson | last post by:
Running as an administrator, I can retrieve the account password stored by IIS for any application pool (using the WAMUserPass property). But, unsurprisingly, an ASP.NET application running inside...
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.