We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,578 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

can anyone help me?

iam thinking if theres a possibilities that i can put a time in time out on my PHP
if you log in thats the time you time in and if you log out thats the time out is that possible??

if yes how??

anyone can help me??
THANKS IN ADVANCE

5
Contributors
4
Replies
22 Hours
Discussion Span
8 Months Ago
Last Updated
5
Views
yumyam09
Light Poster
26 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

actually iam not begging for help im only asking if that is possible

yumyam09
Light Poster
26 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

@yumyam09

iam thinking if theres a possibilities that i can put a time in time out on my PHP
if you log in thats the time you time in and if you log out thats the time out is that possible??

I'm a bit confused. Are you talking about Employee Timesheet?

LastMitch
Industrious Poster
4,391 posts since Mar 2012
Reputation Points: 149
Solved Threads: 352
Skill Endorsements: 47

Yes , it is possible.

First you create a table for saving login time, an unique id and log out time.

When a user login creates a unique id and save it in a session.

Then insert the login time and unique id to the table.

When user logged out, takes unique id session and updates this table with this session and logged out time. After updating, unset session.

Then you will get login time and logout time.

Bachov Varghese
Junior Poster
123 posts since Sep 2011
Reputation Points: 41
Solved Threads: 29
Skill Endorsements: 3

The uproach that Bachov shared can do the work. Of course there could be many variations to it, no need to match session id with the log in id , if you have an architecture that provides different log in ids for each user , and therefore no reason to delete session after log out.

But to be honest it is one of the issues that the solution has to do with how really you mean the “log out” and how important is this for your app. Most users will not even push a log out button, or they will close the tab, the window, the browser or even let it open until session expires (don’t think about onunload event) . So if you really mean it that you want to know the log in time there is a cost to that, for example an AJAX call every x seconds just saying that me with log in id X I am still here.

I am one of those that really anxious of how WebSockets will change the way we work. If we suppose that this technology is available to anyone through any browser, in the same way, then these tasks can be done through that , without even the use of AJAX . How big the cost will be is just a debating subject ( I have done my tests so far but I don’t have a definite answer since this is just emerging).

jkon
Posting Whiz
387 posts since Jan 2009
Reputation Points: 124
Solved Threads: 63
Skill Endorsements: 4

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.7119 seconds using 2.49MB