+ Reply to Thread
Results 1 to 4 of 4

Thread: View all active sessions?

  1. #1
    nam37 is offline Junior Member
    Join Date
    Jul 2009
    Posts
    2

    Question View all active sessions?

    I'm working on the back-end of a Zend Auth/ACL-based site. Is there an "easy" way for an "Admin" (as defined by the ACL) to view a list of all active sessions/identities?

    Thanks for the help.

  2. #2
    Tekerson is offline Senior Member
    Join Date
    Jul 2008
    Posts
    288

    Default

    I doubt there is any inbuilt way, and doing it manually would need some knowledge about how your sessions are stored.

    The default session handler stores sessions in a file, names for the session ID and containing a serialized version of the $_SESSION array. I guess you could iterate over the files, unserialize and extract the information you want.

    The same could be done for DB backed sessions. For memcached (or similar) sessions, you might be out of luck.

    Also, just because the session still exists on the server doesn't mean it's active on the client (ie. they may have closed the browser, started a new session, logged in again.. whatever)

    Another option might be to store the last action time against the user record, then you can grab all the users that have been active within the specified "session time".
    Brenton Alker
    PHP Developer - Brisbane, Australia

    blog.tekerson.com | twitter.com/tekerson | brenton.mp

  3. #3
    hamidhossain is offline Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Lightbulb

    I think you need to change the storage of login sessions to be in database. Then, you can easily query it.

    Regards,
    Hamid

  4. #4
    nam37 is offline Junior Member
    Join Date
    Jul 2009
    Posts
    2

    Default

    Quote Originally Posted by hamidhossain View Post
    I think you need to change the storage of login sessions to be in database. Then, you can easily query it.

    Regards,
    Hamid
    That was my idea also, I was just hoping there was a different way.

    Thanks for the help.

+ Reply to Thread

Similar Threads

  1. Can't detect Active page with Routers
    By tutunmayan in forum Model-View-Controller (MVC)
    Replies: 0
    Last Post: 07-01-2010, 02:25 PM
  2. Active Directory binding...
    By ajlisowski in forum Authentication & Authorization
    Replies: 1
    Last Post: 04-08-2010, 01:32 PM
  3. Replies: 2
    Last Post: 12-11-2009, 10:28 AM
  4. Is this forum not very active?
    By ICEcoffee in forum Forum Feedback
    Replies: 3
    Last Post: 05-30-2008, 04:14 PM
  5. Server Sessions vs. Client Sessions?
    By Elemental in forum Concepts, Ideas, Planning
    Replies: 0
    Last Post: 10-07-2007, 05:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts