This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// This is the result of about an hour's delving into PHP's hairy-ass serialization internals. | |
// PHP provides a session_decode function, however, it's only useful for setting the contents of | |
// $_SESSION. Say, for instance, you want to decode the session strings that PHP stores in its | |
// session files -- session_decode gets you nowhere. | |
// | |
// There are a bunch of nasty little solutions on the manual page[1] that use pretty hairy regular | |
// expressions to get the job done, but I found a simple way to use PHP's unserialize and recurse | |
// through the string extracting all of the serialized bits along the way. | |
// |