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

how to store user login time?

127 100+
i have created a login system. when the user logged in, the login time is stored... i dont have any problem in that.
after login the user moved to the user page. in this if the user refresh the page, it stores the current time in the login time...

so i have multiple login times for the user in the table. how to avoid if the user refresh the page it shouldnt put an entry into the table...
Oct 22 '10 #1
1 1668
dlite922
1,584 Expert 1GB
Each user should use one time. Just to an UPDATE not an INSERT!

Why do you need to keep all those times? Each time there's a submit update their last_activity_time. To check if they're still logged in, make sure X minutes have not passed from this timestamp. And don't use a MySQL DATE TIME field. Use and INTEGER field and just store the Unix epoch time (number of seconds since 1970. See php's time() function.


Dan
Oct 22 '10 #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
3
by: freee8896 | last post by:
Can nyone help me with this multi user login from the same system. Multiple users must be able to login from the same system at a time.... in PHP. Sessions must be used. Please donot suggest these...
2
by: antonyliu2002 | last post by:
I am testing ASP.NET 2.0 Forms athentication with user credentials in SQL Server 2005. I don't want to put user credentials in web.config, so the credentials section is commented out. The...
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...
1
mangat
by: mangat | last post by:
Hi guy's i'm stuck in a similar problem. The problem is that i have two fields one shows the LogIn time of the user and other shows the Duration since the user LogIn and now i want to store the...
22
by: klenwell | last post by:
I'm in the process of refactoring the php code base I've amassed over the last few years into an object-oriented framework. I'm about to start in on the authentication/login extension and I've...
1
by: vineetbindal | last post by:
Hi All, We have an windows application running on different systems , We want to mentain a log of user login time(UserName:LoginTime) can someone please tell me how can i do that. (i have to...
1
by: 9966652260 | last post by:
hello I am currently doing a project on Administrator Module....where a Administrator has to know at this particular time how many users have logged in...... for which i...
12
by: tvnaidu | last post by:
I have Two kinds of web pagess, one is for control page for only admin login, another one is to view status for user login. initially both html files can view with 192.168.0.10/control.htm and other...
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();...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.