I need to implement a system to limit the number of users that can concurrently use my app. I am thinking the best way to go is to count the number of sessions currently active and then limit based on that.
How can I count the number of sessions currently active. I am using memcached to store my sessions if that makes a difference
I think the easiest way is to intercept the session’s
open,destroyandgccallbacks (usingsession_set_save_handler()) and increment/decrement a session count value within memcached. Something like: