By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

Serializing Session variables. Cuts off after a given length????

P: n/a
I've have been trying to serialize an array of objects. I can
serialize and set a session variable and retrieve it successfully for
a serialize string of any length within the contents of a single
script.

$_SESSION['a'] = serialize($b); // strlen($a) = 120,011
print unserialize($_SESSION['a'])
But if I set a session variable and then try to access it on another
page the session variable is always truncated at 67,789 in length. So
the unserialize function cannot correctly interrupt the variable. Why
are my serialized session variables truncated at 67,789???

Thanks
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ryan Hubbard wrote:
I've have been trying to serialize an array of objects. I can
serialize and set a session variable and retrieve it successfully for
a serialize string of any length within the contents of a single
script.

$_SESSION['a'] = serialize($b); // strlen($a) = 120,011
print unserialize($_SESSION['a'])


Why are you serializing the array? You can just do a $_SESSION['a'] =
$b;

Data is automatically serialized when it is inserted into a SESSION. So
the session variable really has a serialized serialized array.

I don't know if not serializing the array before you store it will
help, but it's worth a shot.

Ken

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.