I have made a session management library in PHP that stores session data in databases using functions rather than the trivial $_SESSION['key'] = value
.
To store the data, the user would use storeData($key, $value)
function
To retrieve the data, the user would use getData($key)
function.
However I want my users to still keep using $_SESSION
rather than functions so that old codes do not need to be modified.
Is there a way that if the user uses $_SESSION
, I can somehow get those values and apply to my functions. So the user still would think that they are using PHP's $_SESSION
but in the background they actually would be using my functions.