[eluser]jhabbley[/eluser]
Interestingly, I just ran across a very similar and related problem with Chrome.
We're using flashdata to store some parameters chosen in a simple "filter search results" form so we can page through the data without having to put all of the criteria back into the "next page" or "page 2" links. Works great.
However, depending on the number of flash variables we were setting, we'd eventually get this error in chrome: "Error 325 (net::ERR_RESPONSE_HEADERS_TOO_BIG): Unknown error."
Upon viewing the Response Headers (in Firefox), I saw this:
Code:
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: PHP/5.2.5
Set-Cookie: ci_session=a:4:{s:10:"session_id"%3 (... snip ...); expires=Tue, 15-Sep-2009 23:12:18 GMT; path=/
ci_session=a:4:{s:10:"session_id"%3 (... snip ...); expires=Tue, 15-Sep-2009 23:12:18 GMT; path=/
ci_session=a:4:{s:10:"session_id"%3 (... snip ...); expires=Tue, 15-Sep-2009 23:12:18 GMT; path=/
ci_session=a:4:{s:10:"session_id"%3 (... snip ...); expires=Tue, 15-Sep-2009 23:12:18 GMT; path=/
ci_session=a:4:{s:10:"session_id"%3 (... snip ...); expires=Tue, 15-Sep-2009 23:12:18 GMT; path=/
ci_session=a:4:{s:10:"session_id"%3 (... snip ...); expires=Tue, 15-Sep-2009 23:12:18 GMT; path=/
(... approximately 25 lines removed ...)
Date: Tue, 15 Sep 2009 21:12:20 GMT
Connection: close
Because we're using the DB for sessions, each of the lines beginning with "ci_session=" was identical... and repeated over and over again.
After looking into the Session library, I found the culprit: Each time set_flashdata is called, Session

ess_write is eventually called.
If you're NOT using the DB for session data, then you MUST rewrite the cookie each time a new flashdata variable is set (as the data is stored in the cookie). Makes sense.
However, if you ARE using DB for session data, it still writes out the cookie again... even though only no cookie data has changed (session_id, ip_address, user_agent, and last_activity all remain the same, and user_data is stored in the DB).
So I modified the Session library slightly to fix this:
In /system/libraries/Session.php, I made these changes:
(in the member variable declarations)
Code:
class CI_Session {
var $_cookie_data_written = FALSE; //add this variable
(at the end of sess_write function)
Code:
//
// Write the cookie. Notice that we manually pass the cookie data array to the
// _set_cookie() function. Normally that function will store $this->userdata, but
// in this case that array contains custom data, which we do not want in the cookie.
if($this->_cookie_data_written === FALSE) {
$this->_set_cookie($cookie_userdata);
$this->_cookie_data_written = TRUE;
}
}
Basically, once the cookie has been written to the browser... don't bother writing it again, as it contains no new information.
I hope this helps somebody that runs into this same problem.