Actually the question itself: how can you find out who is currently on the site at the moment and display its name? Required without using a database. While I am busy with sessions, but nothing comes out.

  • one
    If you do not consider the option of entering the login file into the file after authorization and deletion after logging out / not being on the site for more than 10 minutes as the database, this is the only way - Shevsky
  • one
    There was also such an idea with the file, but if for example the user did not press the exit button, but simply closed the browser, then it will hang in the file. - Sharp
  • one
    The db will be the same. - user6550
  • one
    @Vfvtnjd Cookies in their pure form will not help, since there is no feedback. - Costantino Rupert
  • 2
    Lol And it is impossible to keep track of the last activity time and when switching to each new page, this very place cannot be? More than 10 minutes there is no activity - offline. - Shevsky

1 answer 1

Common to all sessions of the site storage, most often - the database and file system. DB discard, remain files. You can organize in different ways.

In one file to write through the tab line:

userid timestamp имя 

At each page request, read this file entirely, delete those lines where the timestamp is older than N, update it for the current user.

You can create in a separate folder for the file for each user , call them by id, or through the point id and name: " 15165.Вася Пупкин ". When prompted to update the contents of the file. And rely on the date of the file modification , to determine the time when people downloaded the page the last time. Files older than N erase.

  • Thank you, I'll try :) - Sharp