zend-frameworkzend-session

How to check logged in online users using Zend Framework


I want to know how to get the number of users currently online or having active sessions on a website using Zend Framework.

I tried the usual way of reading Session save path, but its not working using Zend. Can anyone here suggest me a good method to know how many active sessions are on the server at any moment of time.


Solution

  • You can't use sessions to do this, you would have to store the online users in a DB and display all who are active.on log out delete/update records from db.

    or put a flag in ur users table and update flag as y/n every time a user logged in / log out.

    or something similar to this.

    If user closes browser without logout then when next time user tries to log in. u can check previous active sessions for that user, if there? give a window to user that last logout was not correct and take any event from that user to update time or u can ask user to enter log out time (estimated) for late session or if users are not interested to select time u can update logout with a logout time . make a slandered interval of login duration.

    think like this way......