2

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.

Teshte
  • 624
  • 1
  • 7
  • 26
Rash
  • 7,677
  • 1
  • 53
  • 74
  • 9
    Have a look at session_set_save_handler, http://php.net/manual/en/function.session-set-save-handler.php – hank May 24 '13 at 10:30

0 Answers0