Skip to main content
Known Participant
June 12, 2009
Answered

Track user last time vist to site

  • June 12, 2009
  • 1 reply
  • 591 views

Hi,

     I am looking to track when was the user login last time into site and dislay that time when he login again?

    This topic has been closed for replies.
    Correct answer spill-wjzVEv

    Hi, when you process the login you could just write a time stamp to the database, but you would have to read the previous time stamp before it was overwrittin with the new one.

    Also once you start collection the times you could do some date calculations such as dateDiff and display things like

    You last logged in 28 days ago, you must login more often etc etc

    Richard

    1 reply

    spill-wjzVEvCorrect answer
    Inspiring
    June 12, 2009

    Hi, when you process the login you could just write a time stamp to the database, but you would have to read the previous time stamp before it was overwrittin with the new one.

    Also once you start collection the times you could do some date calculations such as dateDiff and display things like

    You last logged in 28 days ago, you must login more often etc etc

    Richard

    tclaremont
    Inspiring
    June 12, 2009

    Assuming you are logging this kind of stuff in a database, grab the max two rows from your logging database where the user is the current user, ordered by date in descending order. Show #YourDateField[2]# as the previous login. This will show the second record, since the first record should be the current login.