473,322 Members | 1,911 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,322 software developers and data experts.

logging user visit


I am building an ASP application, in this application, one of the
functions is that I have to know exactly how long a user has used a
certain page of the application. so I need a way to long the time a user
enters a page and when he leaves again.

the problem is when the user closes the browser, no time for leaving is
recorded...

Is there a way to run a web service that can read cookies of all the
users and write them to a database? Or am I looking too far for the
solution.

I'd like a clean solution, not with popups, or opening other windows in
order to run extra asp code..

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 1555
You could trap this *sometimes* by writing some javascript in your
pages, trapping the onBeforeUnload event and maybe posting something to
your server then.

But there are ways the user can get past this, e.g. physically bringing
down the connection before they close the browser (disconnecting the
phone line if its a dialup connection), or even (a bit extreme!) just
switching the machine off at the wall without exiting anything.

I'm fairly sure there is no 100% reliable way to achieve what you want.
You can only really record when the user comes back to your site.

HTH,
Pete
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #2
CJM
The most common approach I have come across is to track each time someone
requests a page and record it in a db. Any entries less than 20 mins old
(for default time-out settings) are considered 'live'. That is, if you can
just accept that you are potentially 20 minutes out-of-date when you query
the DB, life is a lot easier.

As Pete has stated, there is currently no guarranteed way of tracking your
users accurately.

I'm not sure if this is helpful to you... Why are you trying to track the
length of time they are on your site? Is it for billing for a provided
service? Or just for your information?

If it just informational, then my method may well be OK. If you need to be
more accurate, I think you will be disappointed..

hth

Chris
"Pete" <an*******@devdex.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
You could trap this *sometimes* by writing some javascript in your
pages, trapping the onBeforeUnload event and maybe posting something to
your server then.

But there are ways the user can get past this, e.g. physically bringing
down the connection before they close the browser (disconnecting the
phone line if its a dialup connection), or even (a bit extreme!) just
switching the machine off at the wall without exiting anything.

I'm fairly sure there is no 100% reliable way to achieve what you want.
You can only really record when the user comes back to your site.

HTH,
Pete
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #3
Have some client side js (assuming it's enabled) make a request for an image
from your server every x minutes, or faster if you need more resolution in
your timings. Put the page name in the img url as a querystring and log it
in a db.

Tim

"Francis Dhaenens" <fr**@pointx.be> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...

I am building an ASP application, in this application, one of the
functions is that I have to know exactly how long a user has used a
certain page of the application. so I need a way to long the time a user
enters a page and when he leaves again.

the problem is when the user closes the browser, no time for leaving is
recorded...

Is there a way to run a web service that can read cookies of all the
users and write them to a database? Or am I looking too far for the
solution.

I'd like a clean solution, not with popups, or opening other windows in
order to run extra asp code..

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4

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

Similar topics

15
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not...
2
by: Greg Scharlemann | last post by:
I have a various different packages within this web application that I am writing and I am attempting to set up log4j to log directly to a database. So each class is calling just a generic logger:...
8
by: pigeon | last post by:
I have 2 users that their client software must be going crazy.. they are sending packets every .02 seconds to the db server... I know this because I stuck a sniffer on teh traffic.. but now i just...
11
by: TomCat | last post by:
Hello, can anyone send me a link or even some sample of script that counts visits to a website ? Thanks, TomCat
11
by: Alan Silver | last post by:
Hello, I am just planning a new ASP.NET site, and wondered about the best way to handle the following common scenario... The site has the option that registered users can log in and will have...
0
by: Frank Miverk | last post by:
Hi, I am not understanding how the Remember Me checkbox is supposed to work here. I have a LoginCtrl (asp.net 2.0, framework 2.0) and all I want to do is remember the user the next time if they...
1
by: manish1 | last post by:
I Want To Develop A Software In Asp Which Handles Following Things: 1. User Name 2. Login And Logout Time In A Particular Website 3. Number Of Downloads From A Particular Website 4. How Much Mb...
1
by: pushrodengine via AccessMonster.com | last post by:
Is there a way to log user actions? What I would like is to be able to log user activities within the database. The table “tblUserEvents” would contain two fields. Field one “EventTime”...
1
by: ludvig.ericson | last post by:
Quote from the docs: FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s" logging.basicConfig(format=FORMAT) d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.