CodeIgniter :: Session Data Randomly Dissappearing

| 2 Comments

Last year I encountered an issue while supporting some code I hadn’t written. The issue was that random session data was randomly disappearing. I consulted with the original author of the code who was adamant that nothing with their code would be responsible for the issue. Recently, I was revisiting the code and had a revelation. They had used the CodeIgniter session library instead of PHP native sessions. After some research I discovered that the CodeIgniter session library uses cookies and as a result limits data to 4kb. This was the cause of the issue. I switched CodeIgniter to use database storage and the issue was resolved.