Hi,
i want to get the amount of visitors online.
I did this in global.asax
I tested it by opening several browser sessions.
The amount increases, but never decreases, when i close some browsers.
I have heard of 'session.abando n' but have no idea where to put it (not in
Sub Session_End because it's not fired)
I don't want to use the session.timeout .
My web.config doesn't contain any session state of any kind.
Thanks for hints
Chris
Sub Application_Sta rt(ByVal sender As Object, ByVal e As EventArgs)
Application("vi sitors") = 0
End Sub
Sub Session_Start(B yVal sender As Object, ByVal e As EventArgs)
Application("vi sitors") = Application("vi sitors") + 1
End Sub
Sub Session_End(ByV al sender As Object, ByVal e As EventArgs)
Application("vi sitors") = Application("vi sitors") - 1
End Sub 4 2233
"Chris" <cc@dd.ddwrot e in message
news:OB******** ******@TK2MSFTN GP04.phx.gbl...
Session_End fires when the session ends.
Closing the browser does *not* cause the session to end - this a very common
misconception.
If you want the number to decrease, you will have to force Session_End to
fire by calling Session_Abandon () - the usual way to achieve this is to have
some sort of "Log Out" button, but there is nothing you can do if the user
simply closes their browser...
-- http://www.markrae.net
Thanks for replying ..
Where have i do put that Session.abandon ?
I mean: in which event (Page_UnLoad ?)
Thanks
"Mark Rae" <ma**@markNOSPA Mrae.netschreef in bericht
news:ON******** *****@TK2MSFTNG P02.phx.gbl...
"Chris" <cc@dd.ddwrot e in message
news:OB******** ******@TK2MSFTN GP04.phx.gbl...
Session_End fires when the session ends.
Closing the browser does *not* cause the session to end - this a very
common misconception.
If you want the number to decrease, you will have to force Session_End to
fire by calling Session_Abandon () - the usual way to achieve this is to
have some sort of "Log Out" button, but there is nothing you can do if the
user simply closes their browser...
-- http://www.markrae.net
"Chris" <cc@dd.ddwrot e in message
news:eo******** ******@TK2MSFTN GP02.phx.gbl...
Where have i do put that Session.abandon ?
I mean: in which event (Page_UnLoad ?)
You seem to be getting a bit confused with how ASP.NET pages work...
Page_Unload fires just after the page has been rendered into HTML and
streamed down to the client, not when the user closes the page: http://msdn2.microsoft.com/en-us/library/ms178472.aspx
Do you have on-line banking? If so, then that website will (almost)
certainly have a "Log Out" button or hyperlink which they encourage you to
click rather than just closing your browser or moving to a different site -
the Session_Abandon () method goes there...
There is no way whatsoever for ASP.NET to know that a user has closed their
browser...
-- http://www.markrae.net
Ok, thanks again
"Mark Rae" <ma**@markNOSPA Mrae.netschreef in bericht
news:ua******** ******@TK2MSFTN GP04.phx.gbl...
"Chris" <cc@dd.ddwrot e in message
news:eo******** ******@TK2MSFTN GP02.phx.gbl...
>Where have i do put that Session.abandon ? I mean: in which event (Page_UnLoad ?)
You seem to be getting a bit confused with how ASP.NET pages work...
Page_Unload fires just after the page has been rendered into HTML and
streamed down to the client, not when the user closes the page: http://msdn2.microsoft.com/en-us/library/ms178472.aspx
Do you have on-line banking? If so, then that website will (almost)
certainly have a "Log Out" button or hyperlink which they encourage you to
click rather than just closing your browser or moving to a different
site - the Session_Abandon () method goes there...
There is no way whatsoever for ASP.NET to know that a user has closed
their browser...
-- http://www.markrae.net This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Eric |
last post by:
I need an effective way (time is my main concern here) to generate 10
000 000 unique alphanumeric strings of 16 characters each.
I used STL set and map but after about 5 000 000 entries, it becomes
very slow, even if I still have enough RAM available on my computer
Do you have any advice?
Here a code sample that I used to ensure uniqueness.
|
by: bilbothebagginsbab5 AT freenet DOT de |
last post by:
Hello, hello.
So. I've read what I could find on google(groups) for this, also the faq of
comp.lang.c.
But still I do not understand why there is not standard method to "(...)
query the malloc package to find out how big an allocated block is". (
Question 7.27)
Is there somwhere explained why - because it would seem to me, that free()
|
by: OldProgrammer |
last post by:
All the documentation and discussion I have read indicate that the
Session_End is not supposed to fire unless you are in "inProc" Session state
mode, and then only on Session Timeout or at Session Abandon. I need the
event to fire at Session timeout in order to capture and store the Datetime
this occurs. However in the application I am writing, I have been unable
discern any indication that the event is firing. I have used break...
|
by: ip2location.inc |
last post by:
IP2Location has announced the availability of IP2Location .NET
Component, that enables application developers to geolocation the
Internet visitors by IP Address from their .NET applications.
IP2Location .NET Component is fully managed code written for .NET
Framework. The component enables you to discover in real-time, where
your web visitors are coming from by IP address. You can then
dynamically tailor the content of your site based on...
|
by: johnny |
last post by:
hi all!
I am starting to study the best way to track site visitors.
Logfiles stats which come with every web hosting, have little metrics
to be analyzed and also problems with cached pages which are not seen.
I thought to use php and cookies to track returning visitors, however I
see that all pro solutions use javascript to set cookies.
Now since I prefer to avoid js as much as I can cause they can be
blocked by browser settings, is it...
| |
by: damezumari |
last post by:
I would like to know how many of the visitors to my site has js enabled
and how many has it turned off.
I haven't found a simple solution searching Google groups so I suggest
the following using php and mysql:
Create a table mc_jscount table in mysql with two fields nonjs (int)
and js (int). Create one record with nonjs and js set to zero.
Put this code at the top of your page:
|
by: christophe.chazeau |
last post by:
Hi,
I have a problem with a really simple chunk of code which should work
but does obviously does not.
This chunk of code is just a POC aimed at finding a bug in a larger
project in which the same problem seems to occur.
Here the deal : when I run this piece of code, I expect all the memory
allocated by the "Test" object to be freed but what I observe is that
after the second sleep (after all the additions to the vector), the
memory...
|
by: Hong Chen |
last post by:
I developed a large program and found the program does not really
release memory after the delete operation is taken, since, according
to "performance monitor", the virtual bytes used by this process does
not decrease after 'delete'.
Is this because the heap allocator holds the deleted memory for future
use? Is there anyway to force the release of the memory since we
confront problem of memory allocation failure if the delete memory is...
|
by: r_ahimsa_m |
last post by:
Hello,
On index.html page I have a table with id="property_fields".
<table id="property_fields" name="property_fields" border="0">
It contains set of rows with the following IDs:
var propertyRows = new Array(
"region_row", "town_row", "district_row", "address_row", "house_row", "floor_no_row", "rooms_row", "floors_row", "area_row", "year_built_row",
"ownership_row", "standard_row", "garrage_row", "parking_row", "kitchen_row",...
|
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,...
|
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...
| |
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,...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |