469,926 Members | 2,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

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

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
1 3076
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.

Similar topics

3 posts views Thread by M Wells | last post: by
4 posts views Thread by Angelos Karantzalis | last post: by
3 posts views Thread by Enoch Chan | last post: by
2 posts views Thread by Tobias Zimmergren | last post: by
3 posts views Thread by Jessica Loriena | last post: by
9 posts views Thread by Greg Linwood | last post: by
31 posts views Thread by Harry Simpson | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.