473,472 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to track user login time and logout time

1 New Member
I had created a database to capture the user logged in time and user logged out time. But may I know how do I code what time the user had logged in and logged out in my login and logout page so that it will store in the database?
Oct 29 '11 #1

✓ answered by michaeldebruin

I don't know if it is the best way to do it, but I always simply use an if statement and a bool variable. When somebody is logging in switch the bool to true and use the if statement (and a timespan) to catch the time and save it in the database. And the same plan for logging off. Switch the boolean to false and again use an if statement to catch the time and save it in to the database.
But if you have more experience with background workers I think it should be possible to use them to get the same result.

1 6243
michaeldebruin
134 New Member
I don't know if it is the best way to do it, but I always simply use an if statement and a bool variable. When somebody is logging in switch the bool to true and use the if statement (and a timespan) to catch the time and save it in the database. And the same plan for logging off. Switch the boolean to false and again use an if statement to catch the time and save it in to the database.
But if you have more experience with background workers I think it should be possible to use them to get the same result.
Oct 29 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Joey Lee | last post by:
Hi, Does anyone knows how to control user login that only a single userid can login at a time? Thanks Joey
0
by: sam.jones | last post by:
Hi All, I am writing a service in C# and I need this service to be able to listen for user login and logout events. I have heard that I can use WMI to do this by using wqleventquery. Can...
1
by: G | last post by:
Hello Friends, Can i find any sample free webbased-application for employee login and logout timing. Thanks in Advance Appreciate for your Help. Thanks G
0
by: onlymukti4u | last post by:
Hi All, Can anyone help me out to get the code for knowing the login and logout time difference between some pages. What exactly I want is...."I have a small project having 5 pages,once the...
5
by: donaldmazig | last post by:
Hello, I am currently working in a database with user security level. What I want to add is a field in a form with type memo where all the user's name, login and logout date and time are recorded....
10
by: Mel | last post by:
I am using "windows" authentication mode. I would like to store the username and various information when the user logs on to the website. Any ideas? It would be a bonus to store the logout...
3
by: kashok | last post by:
hi, how to track users login/logout time on our site and store it in database Thank U Ashok
1
by: naveenkongati | last post by:
Hi, My application is designed under MVC2 architecture which includes JSP,Servlet,DAO and bean. In this application i am tracking a user login details into a table. When user logs out i am...
3
by: impin | last post by:
i wnat to store the login time and logout time in the database.... plz help... also how to retrieve stored logiin.logout times from database.... when i use the simple time disply $t=time();...
1
by: jagjit maan | last post by:
how to subtract the two times . one is login and second is logout .the time is get from the database but with two tables .one is login and second is logout .i got the both the time but how to...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.