Count Session and Trigger Events

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leulae
Forum Newbie
Posts: 14
Joined: Fri Jan 01, 2010 2:48 am

Count Session and Trigger Events

Post by leulae »

I am seeking a method to count logged users by counting the sessions or any …, is there any way to do it without using a database, and also eager to know a method to make to throw an event before and after session expired.

Thanks in advance
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Count Session and Trigger Events

Post by requinix »

There is no reliable way. Use a database. Seriously.

For events, PHP runs when it's told to run. And it doesn't provide any kind of onSessionDestroyed event for you to listen to.
If you want that much control, make your own session handler and add events there. You won't quite get the ones you want, but you'll be able to do something.
Post Reply