The PoC Session Handler
So, it's glorious.
The session string, saving, etc is all done by voodoo magic. When the session class is constructed it does what it needs.
Basically all you ever need is:
$this-> is assumed to be the context, adjust as necessary.
// to add: $this->session->setValue([name], [value]); // to read: $this->session->getValue([name]); // to remove: $this->session->removeValue([name]); $this->session->removeAll(); // Optionally you can destroy the session: $this->session->removeSession(); // You can force a reload of all the values from the db: $this->session->loadValues();
When setting a value, it can be anything. The value will be serialized before stored, so go to town.
There are many other functions within the session handler, however, they're mostly unused by the application and they should remain on the underside.
This class should be made into a singleton so that it only gets created once in the entire app.