Welcome Guest, Not a member yet? Register   Sign In
Cookies too large!
#1

[eluser]theseamusjames[/eluser]
So I built this beautiful, sophisticated wizard for my company that functions by building these elegant, complex objects through a series of questions (30 of them), and now we've hit a pretty major snag.

We save that object to a session var during the construction process, then write it all to the DB at the end. Problem is, with the right combination (or wrong combination, if you're me) of options, the session object gets too large and the browser drops the cookie. It seems we're hitting that 4k limit.

What I'm wondering is, if I break up the object and use more than one "set_userdata" to save the objects, will it write them to multiple cookies and thus avert the single cookie size limit?
#2

[eluser]danmontgomery[/eluser]
No.

Why not use database sessions?
#3

[eluser]theseamusjames[/eluser]
We have that enabled, but we still seem to be hitting a limit.

Basically, we're building objects that start with 'categories'. You can choose as many 'categories' as you want to build, and then each one of those has something like 40 pieces of data, and some pieces of data have 10 or so further pieces of data. We've found if you create about 20 of these categories, at about the 2/3rds point the cookie disappears. Any fewer and you can complete the process no problem.

The objects begin as a stdClass, which we write to a session as follows:

Code:
$category_data = array ( 'category_data' => $categories );
$this->session->set_userdata ( 'category_data', $category_data );
#4

[eluser]InsiteFX[/eluser]
Try changing the ci_sessions table user_data to a mediumtext or longtext type.

The cookie only stores the session_id so your running out of room in the database.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB