Jump to content

Is it possible to iterate over all active php sessions?


jipskin

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.