Welcome Guest, Not a member yet? Register   Sign In
Proper way to capture and display last login time
#1

[eluser]gwerner[/eluser]
I'm creating a fairly simple admin for a web site I'm developing. I'd like to display the users last login time. I just want to make sure I'm going to go about this right. My initial thoughts are I'd just add a column in my users table 'last_login'. When a user logs in read that column and put in the session array. Right after that I'd update that column field with the new log in time for the next time that user logs in.

Another option I thought might work would be to store the login time in the session database. But, I don't think there will be an easy way to retrieve that when the user logs in. Any help or guidance is appreciated.
#2

[eluser]InsiteFX[/eluser]
Just like you said store in in the users database record.
#3

[eluser]gwerner[/eluser]
Thanks for the reply. I just wanted to make sure.




Theme © iAndrew 2016 - Forum software by © MyBB