mpsn Posted November 10, 2011 Share Posted November 10, 2011 Hi, I want to maintain users who log in a webpage and each time they leave, I want to record the current time, so this sounds silly but do I just set in my db table in a field that tracks a user's last log in with DEFAULT: CURRENT_TIMESTAMP? db structure: user_id lastActivity lastSession (stores TIMESTAMP of last time user logged in) Any help much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/250848-store-last-session/ Share on other sites More sharing options...
sunfighter Posted November 10, 2011 Share Posted November 10, 2011 Your method of storage is good. But most people that track last visit normally just log the month, day, and year, because most people will just go to another web site and you have no way of finding out the time they did that. Leaving your site is the same as just turning off the browser. How would you know? If you have an inactivity function you might get close to the time, but it just sounds like a lot of work for no return. Quote Link to comment https://forums.phpfreaks.com/topic/250848-store-last-session/#findComment-1287111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.