Блог пользователя honest_critic

Автор honest_critic, 3 года назад, По-английски

You all have noticed Last visit feature on profile page of every user. Me being a web developer is curious that how this feature is implemented on CF. As per my knowledge, CF website doesn't send background data to server while user is solving some problem.

Does this feature rely on the last time when user visited CF or reloaded any CF page?

I am thinking to implement same feature in one of my project but I doesn't want to use Ajax or any Asynchronous requests. That's why I am trying get idea regarding this feature's implementation.

MikeMirzayanov

  • Проголосовать: нравится
  • +58
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For an easy but maybe not the best way:

Every time a request is made to the server which is authenticated(by logged-in user), you can just update the last visited field in DB for that user. You can do it by making a middleware or like a pro coder, copy paste some code at starting of every route