I just noticed that my host started using Suhosin Hardening, i'm not quite familiar with this and am having major issues with my application, mainly in sessions.
The session is nowing being stored in the following format:
_EzyqHpPJqmQbSpRmXAJTxuFq980aNQlc3XAiRkWxlZQ9B0fnV...
I don't mind that but its also breaking my application, i need a way to decode the encryption because its not letting me login to my app because of this.
I have a function to unserialize the session data, not sure where i picked up but here it is:
public function unserialize_session_data($data)
{
$variables = array();
$a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
for( $i = 0; $i < count( $a ); $i = $i+2 )
{
$variables[$a[$i]] = unserialize( $a[$i+1] );
}
return($variables);
}
It's giving offset errors with that function, because the session data is not in the format it is expecting and thats why i was wondering if anyone knows of a method to decrypt / decode the above ugly suhosin data to present it in its original format?
-- EDIT --
Posting the function which uses the above unserialize function
/***********************************************************************
# Get Session Data of a certain session id
# --------------------------------------
# This function will retrieve all session information related to a certain session id from
# the database, after that it unserializes the data and returns an array of data.
#
# @return array (Containing Session Data)
***********************************************************************/
public function get_session_data($session_id)
{
if (isset($session_id) && $session_id != "")
{
$sql = mysql_query("SELECT ses_value FROM sessions WHERE (ses_id = '$session_id');") or die ("MySQL Error : <b>" . mysql_error() . "</b><br />");
if (mysql_num_rows($sql) > 0)
{
$res = mysql_fetch_assoc($sql);
$res = $this->unserialize_session_data($res['ses_value']);
return $res;
}
}
}
Thanks in advance!