php - How to monitor if $_SESSION vars changed - Stack Overflow

admin2025-04-27  3

I coded a function (in a CodeIgniter 4 project) which checks on every site-load the session vars, if there are only wanted values.

It works, but normally 99,9% of this function is senseless because no values changed or added.

So I want to ask if there is a simple or more efficient way to monitor if the data of $_SESSION has changed. Maybe as a kind of event or something else?

Is this or nearly this possible (without comparing all values again and again to check if there are changes)?

转载请注明原文地址:http://anycun.com/QandA/1745708792a91125.html