Solved

Login tracking...

Posted on 2001-08-14
6
190 Views
Last Modified: 2013-12-24
I have an application that tracks users, and only allows one user to use their logon at that time...

The question that I have is how do I track a users time spent logged in? I have the start time inserted into a table called http_refer and want to be able to pull information that pertains to the record where the Start time was inserted...

So the user that logged in at 10am (referer_ID=218) will be logged out at 10:30am with that same referer_ID...

The table info is connected to the http_referer table using the info.company_ID (Pk) and the http_referer.company_ID (Fk).

If anyone can understand what I am talking about AND can help me, that would be great...

Gordon
0
Comment
Question by:webmaster256
6 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6385018
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 34 total points
ID: 6385037
Ignore my last comment...

Here is a decent way to track a user's time.

When the user logs in update a FirstLoggedIn timestamp.

Now everytime this user requests a new page update another field LastLoggedIn timestamp.  Now with every request this field will be updated but you should get a pretty acurate read on the time spent.

It is a hit on the DB though.. with all the updates.

CJ
0
 
LVL 1

Assisted Solution

by:snakehollywood
snakehollywood earned 33 total points
ID: 6402138
But then if you use client variables stored in a database, this is also a hit on every page. So you can kill 2 birds with one stone and read info from the clientstorage database to setermine how many people are logged in.
0
 

Assisted Solution

by:brettstil
brettstil earned 33 total points
ID: 6432849
You also need to be aware of the session timeout settings.  The CF default, I believe, is 20 minutes.  If a user clicks a logout button, then you know exactly when they logged out.  But if their session times out instead, you could either use the last page view time or the last page view time plus the session timeout as the "logout" time.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10837368
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation in the Cleanup topic area:

Split cheekycj & snakehollywood & brettstil

Please leave any comments here within the next four days.

mrichmon
EE Cleanup Volunteer
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
nginx with multiple websites --need help with phpmyadmin please 5 47
URL redirect 4 47
SCCM vs Windows server 5 72
PHP Register global 21 64
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now