You must store the session data in the database , this is achieved by "redirecting" the save handler to your database save functions, for example
session_set_save_handler ( callback $open , callback $close , callback $read , callback $write , callback $destroy , callback $gc )
Callbacks are obvious. if you do a quick google search, you will find a bunch of tutorials on this subject, so you won’t have to write it from scratch. In addition, if you intend to implement your own session class, be sure to read Chriss Shiflett's article “The Truth About Sessions”
source share