473,698 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session count always increasing

hi all,

I am counting the number of users logged in my website. That's how I do in
my global.asax (asp.net 2.0)
- in my application_sta rt I initialize an application variable with 0;
- in session_start I add my application variable + 1
- in session_end I decrease application variable -1
my session timeout is 60.
Then I display in the welcome page the total of visitors. So is ok, I open
some browsers in my computer and I see the number of connected users
matching.
But it does not matter how many people get connected, the number never
decreases. Even when I close my windows, the number is still there.
is that a normal behaviour? how to kill a session when it is not in use
anymore?

thanks in advance
xisco
Mar 7 '06 #1
2 1643
hi
You need to lock the application while doing increment or decrement in the
counter.

2nd thing, you should call the session.abdon in when user click signout..

Best of luck...

Munawar
"xisco" <xi***@hotmail. com> wrote in message
news:uy******** ******@TK2MSFTN GP15.phx.gbl...
hi all,

I am counting the number of users logged in my website. That's how I do in
my global.asax (asp.net 2.0)
- in my application_sta rt I initialize an application variable with 0;
- in session_start I add my application variable + 1
- in session_end I decrease application variable -1
my session timeout is 60.
Then I display in the welcome page the total of visitors. So is ok, I open
some browsers in my computer and I see the number of connected users
matching.
But it does not matter how many people get connected, the number never
decreases. Even when I close my windows, the number is still there.
is that a normal behaviour? how to kill a session when it is not in use
anymore?

thanks in advance
xisco

Mar 7 '06 #2
yes, was the abandon missing.
thx
xisco
"Munawar Hussain" <mu*******@msn. com> wrote in message
news:ud******** *****@TK2MSFTNG P14.phx.gbl...
hi
You need to lock the application while doing increment or decrement in the
counter.

2nd thing, you should call the session.abdon in when user click signout..

Best of luck...

Munawar
"xisco" <xi***@hotmail. com> wrote in message
news:uy******** ******@TK2MSFTN GP15.phx.gbl...
hi all,

I am counting the number of users logged in my website. That's how I do
in my global.asax (asp.net 2.0)
- in my application_sta rt I initialize an application variable with 0;
- in session_start I add my application variable + 1
- in session_end I decrease application variable -1
my session timeout is 60.
Then I display in the welcome page the total of visitors. So is ok, I
open some browsers in my computer and I see the number of connected users
matching.
But it does not matter how many people get connected, the number never
decreases. Even when I close my windows, the number is still there.
is that a normal behaviour? how to kill a session when it is not in use
anymore?

thanks in advance
xisco


Mar 7 '06 #3

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

Similar topics

27
7117
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the user accesses it (not just once and then store it in the session). If a secure app is multi-page,...
1
2441
by: Sean Pinto | last post by:
Ok, you all are going to have to bear with me on this one as it is kinda complicated to explain. I am implementing a company management suite that requires Role-Based authentiations (ie. users are in groups and groups have roles). I have one script which is included in EVERY page in the protected area (masterFuncs.php) and it contains function declarations as well as the authentication module kick-off. Here is a snippet from masterFuncs...
7
1417
by: Name | last post by:
To those that can save me from myself: I have a site that has been working perfectly for a few years now, under PHP 4.2.3. Since later versions of PHP run so much more quickly, I wanted to update this site to one of those later versions. Being a very cautious person, I started with 4.3.11, since it was the highest version of the next PHP increment. When I tried this version, my session file kept getting rebuilt (with the same name) as...
2
1369
by: cmrchs | last post by:
Hi, I have following function in a WebService-class : public int Count() { if ( null == Session ) Session = 0; else
6
5123
by: Vik | last post by:
A dataset is saved in session state. Then the dataset is filled out with the new records using a dataadapter. It appears then that the dataset saved in session state contains the new records even without saving the updated dataset. Why does this happen? How can I preserve the dataset saved in session state from automatical updating? Thank you.
0
1716
by: nbdy9(nospam) | last post by:
I have a ASP.Net website (mobile). From time to time the browser popup the following message. Anyway to catch the error and redirect to my start page? saying, login.aspx? Thanks. ======================================================================= Server Error in '/mobSec' Application. The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the...
14
4831
by: Lauri Kotilainen | last post by:
Hi, I've already tried several avenues for this, and am quite stumped. The issue I'm facing is a weird case of sessions getting mixed up (ie. users seeing each others' data). Apparently this happens at peak load times. The configuration is W2K3 with ASP.NET 1.1, IIS6.0, Cookieless sessions and SQL Server as a Session State backend. The problem appears with InProc sessions as well.
7
2041
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below, it retreives the Menu from session and assigns its reference to Menu1. Within the Page_Load event I can see its internal values which have been retreived for each menu item and so it looks good. However, when the Render method is called of...
2
2437
by: Daflookie | last post by:
For one reason or another I am unable to access Session contents in my asp.net application via the global.asax's Application_Error event. I can pull this exact code snippet below out of global.asax and place it in a normal page (or class file that doesn't inherit from system.web.ui.page) and things work fine: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim currentContext As System.Web.HttpContext =...
0
8674
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
9027
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...
0
8861
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...
1
6518
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
5860
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();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
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
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.