jipskin Posted December 20, 2007 Share Posted December 20, 2007 Hello, I am building a site that is experiencing extremely rapid growth and I need to optimize my code as much as possible. One thing I am doing is trying to save trips to the mysql db by storing intermediate data in session variables, and I would like to save these session variables to the database only when these sessions expire. Could anyone figure out a way to do this? I have thought about using session_set_save_handler but my understanding is that if I use this function to write the session data to the database then php will just call those functions between requests and I will see the same kind of poor performance I'm currently seeing. I also thought about somehow iterating over all active sessions and pushing the ones to the db that are older than 10 minutes - but is this possible? Any help is much appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/82485-is-it-possible-to-iterate-over-all-active-php-sessions/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.