Skip to content
Advertisement

Tag: session

How can I unserialize session data to an arbitrary variable in PHP?

I want to unserialize a session_encode()’d string of session data to my own array (i.e. not to $_SESSION.) There doesn’t appear to be an in-built function that handles this. There’s session_decode() but it writes directly to the $_SESSION super-global. There’s unserialize() but it returns false on session_encode()’d strings as they’re a slightly different format. What’s the best way to do

Advertisement