ezsystems/ezflow — pull request #45 by fdob (2013-04-04 11:26:31+00:00)
Title: EZP-20654 - Remove extraneous block state data from eZPageBlockState cookie

Currently ezflow handles block visibility state (expanded / collapsed) by keeping track of individual blocks (by id) in an `eZPageBlockState` cookie, in a format like the following:

```js
eZPageBlockState=id_a23db493243429c8087e087o987=1&
id_478d8a43429c8087e087o987=0....
```

According to HTTP RFC 6265, and implemented by most user agents (that I'm aware of), cookies are limited to 4096 bytes of content. In the (understandably unrealistic) situation where a user has an object with ~100/200 blocks, or the (very realistic) situation where the user has multiple objects with a number of blocks within, **this total size is very easily exhausted**.

This pull-request does not attempt to fully resolve the issue, as the implications could possibly be too wide-reaching, but reduces the amount of data put into a cookie to at least increase the ceiling for this limitation.

## Changes overview:
- Rename the cookie to `eZPageBlockHideState`
- Do **not** add the block's state to the cookie if it is expanded
- Do add the block's state to the cookie if it is collapsed (value `1` - the block is hidden)

This in reality translates the limit from a limitation of total number of blocks edited, to total number of blocks collapsed.