Skip to content
Advertisement

php redis session save handler extending function gc (garbage collection)

Is there a way to extend phpredis session.save handler to call a function when garbage collection happens?

JavaScript

I am looking to add an additional cleanup step for my session. The data I want to cleanup are temporary files in a database.

If it isn’t possible to extend phpredis would there be a way to write a function that uses to simulate session garbage collection with the below ini settings?

JavaScript

Advertisement

Answer

Here is what I came up with

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement