473,626 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Counting active users when using sessionState mode=StateServe r ?

The subject says it all, more or less.
With sessionState mode=InProc in web.config this works fine, using this
approach in the global.asax:

In the session_start event the count up:
Application["UserCount"]=(int)Applicati on["UserCount"]+1;

In the session_end event the count down:
Application["UserCount"]=(int)Applicati on["UserCount"]-1;

However, with sessionState mode=StateServe r, the session_end does not fire,
so a workaround has to be appended.
I just haven't found the best approach yet. I have tried one suggestion,
where another event was added to the global.asax
(Application_Pr eRequestHandler Execute) where the reading of the current
userID stored in a session var was a part of the idea. However, I got an
error message, saying the "session is not available...." or something like
that. Then I tried to implement a needed Http module in the web.config for
this, but obviously I got rather lost with other error messages about wrong
assembly.

So, before I stumble more in half blindness, I would be happy for any
pointing directive.

Thanks.

Bjorn
Jun 27 '08 #1
0 1279

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

Similar topics

0
1740
by: Jeffry van de Vuurst | last post by:
Hi, I have a page with EnableSessionState=readonly in the page directive. A couple of strange things happen. When I try to add something to the session, I get no exception. Immediately after adding the dataset to the session, I can view it in my Watch window. The watch window also shows that the session is readonly. I would expect an exception when adding something to a readonly session.
1
1284
by: Seth Broomer | last post by:
I am losing my session state for some reason randomly and i don't know why i store just simple things like an id for the user, and their username, etc. maybe 10 items per user it happens about every 5 min. in my web.config file i have <sessionstate mode="StateServer" stateConnectionString="tcpip=127.9.9.1:42424" sqlConnectionSTring="data source=127...."
2
4498
by: Dhaval Mehta | last post by:
Thanks in advance I want sessions information for the asp .net application ( mainly SessionId). I am using Oracle as back end. I have sessionid using Session.SessionID in asp .net. I am gettin session id value in program like "piaelorpl0xqn0vtjlawi2vq". I want complete information for this ID like start time, last access time etc. I can get all of this information when sessionstate mode is SQLServer
8
2211
by: GeekBoy | last post by:
I understand the benefit of pushing the StateServer process onto another computer to "balance" the load and take some cpu and memory usage off the web server, but how much could it possibly help? Especially when you're talking about marshalling the data back and forth across your network (although on the same segment)? Here's my scenario: Each login stores exactly 3 session variables; one integer and two strings. That's it. Never, ever,...
10
3499
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user
0
945
by: Joer996 | last post by:
I am using StateServer and URIs to manage state. Here is my web.config line <sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="UseUri" timeout="500"/> Everything works fine until I try to use a relative path in a link. ex href="../index.aspx" This causes the session to restart. Can anyone tell me why this is? It
4
5274
by: archana | last post by:
Hi all, I am new to web services. I am using stateserver to stored data which i set using session. I changed mode in web.config file to StateServer. But didn't change tcipip address. I kept default value as it is. So my question is what this address specifies.127.0.0.1:42424. And can is specify my PC's ip adress instead of this address. IF yes how will i
0
4372
by: Med | last post by:
Hi, My Settings in web.config: <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1; Trusted_Connection=yes" cookieless="false"
4
5505
by: tim007 | last post by:
Hi, How can we get tthe number of active users connected to our web application. I have added application varible that gets incrimeted at session_start and then is decreased at session_end void Session_Start(object sender, EventArgs e) {
0
8262
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
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
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
8637
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
8364
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
7192
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
6122
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...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1507
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.