[eluser]Unknown[/eluser]
This had me foxed for a while.
I was getting this error on mobile only and only when using cellular.
I tried everything here
* mb_string fix
* change ci_sessions to UTF-8
* change ci_sessions.user_data to LONGTEXT
nothing worked.
I went back to basics and broke out the Chrome Dev Console and spotted the issue.
As my app runs through I was blindly executing a whole load of $this->session->set_userdata("bob", "value");
On entry to my app I was clearing these just in case they were still set. That led to 17 $this-?session->unset_userdata("bob") calls.
What I hadn't realised is that every one of these was adding a new header line with the cookie in it. Repeated over and over.
When this was being relayed over 3G their gateways were baulking over it and corrupting the headers by truncating them.
This caused the unserialise to fail. I reduced my calls to set_session and unset_sessions and doing all the work in one go and my problem vanished.
Hope this helps.
A very truncated extract from and HTTP request is below. The set-cookie was repeated for every set_userdata / unset_userdata I called.
Matt
HTTP/1.1 200 OK
Date: Sat, 06 Jul 2013 00:00:10 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
X-Powered-By: PHP/5.3.8
Set-Cookie: ci_session=q/Vn/OHstQ47IJ+ymFQCcIHYWWNE+5snApuE9ohLSAwJmSIdcvusdbNZClkS7/L7fSNRRV9Rded9R2jhIECrVPK5RyMdOqvoF+zxKLdfj8TxsMhB8cbA0h10xVnXyhBoQR+kLyQufqCLRJ9854QuT21JVPXCXX+AVKoIIcKaBA3R6x7T2b496lRrY+Micu+9A9GOxkJCYyDRJONFbgUtdBYAcMNWAjgMQpgrOGbM3RF8gG9UQfvclZAjs2VGJLGaH62GMGRrBvJxd9Grpt4XFB4NyV94KwpuF1LMmgyp7DRKSX+sc52t6a+90fJm2Nw+1i9lLUqxqtafDM2rafK45uCdVIDdMe0TB9vfCiCiAlbbalVheHHSmiCXywoAeeEstSH2T98TfNAmc39SCevULzorfL87P+2yCHliIKAyE6c=; expires=Sat, 06-Jul-2013 02:00:10 GMT; path=/
Set-Cookie: ci_session=XpFmcBfUCH4ieDFE0hEHftu6r/6eBdZuJtw1NTwBDkuGHXWIkg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zAyiol/REmLWGjyWtOlmobZvIe2lw2qPrzhaLFbk7xZHc+9waCVva1Za/+LOd7nR5LEDu8LytYtpqWugeYfgGJG5NHDRJ3+xEJs5LzfnsegP64Oc1nWVLZRbiX2qWT/3sz4ll39nlPFiD+cpdFsMnBdeUroH7Dy460H2Efrxylq4Tus/dlgqop9JDdX8wxhbzyqKOxdaH9MHDdgZiQ7qNgeruFaXHm8PCKk4PS8NQ+qVTp/4g4SR3qj2m+sl9Q=; expires=Sat, 06-Jul-2013 02:00:10 GMT; path=/