Flashdata being cached - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Flashdata being cached (/showthread.php?tid=13382) |
Flashdata being cached - El Forum - 11-20-2008 [eluser]Daniel H[/eluser] I'm experiencing a really frustrating problem with storing flash data with database caching on. It seems that session data is cached along with every other query, yet I obviously would never need this to be cached. Can anyone recommend how I can stop session data being cached? Dan. Flashdata being cached - El Forum - 11-20-2008 [eluser]Daniel H[/eluser] Sorry to bump - has anybody experienced this problem before I raise a bug? Flashdata being cached - El Forum - 11-25-2008 [eluser]laxkin[/eluser] [quote author="Daniel H" date="1227242983"]Sorry to bump - has anybody experienced this problem before I raise a bug?[/quote] Yes, I have same problem. I was planning to write a standalone post but found that one. There is a BUG with DB caching and session flashdata. The sequence(schematic) to reproduce this bug from my own project: - uri: /admin/edit/articles on this page request 'message' from session flashdata by session->flashdata('message') as result executed sess_read() and this query is cached An user can click the following url on the page: /admin/delete/article/<id> - uri /admin/delete/article/<id> sess->set_flashdata('message', 'bla-bla'); inside sess_write method executed there is a call of db->update (store 'message') redirect to /admin/edit/articles (1st page) - uri: /admin/edit/articles sess_read() -> get cached data without 'message' WORKAROUND 1: extends CI_Session and wrap sess_read method as below UPDATE: Create a new file MY_Session.php inside /aplication/library folder and copy/paste the following code: Code: <?php WORKAROUND 2: Turn off the DB cache p.s. I hope this will help you to solve the problem. |