![]() |
flashdata not cleared - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: flashdata not cleared (/showthread.php?tid=24138) |
flashdata not cleared - El Forum - 11-01-2009 [eluser]shinokada[/eluser] According to the user manual, it says flashdata are automatically cleared. However it does not disappear in the following code. It shows "Invalid email. Please try again!" always. How long flash data keep it data? Is it for 5 min as a default like session data? Controller Code: <?php Views/subscribe.php Code: <?php flashdata not cleared - El Forum - 11-01-2009 [eluser]iFadey[/eluser] Flash data is is not cleared after a specific time. I mean there's no time limit for it. It's cleared when you consume it once. On next page request it will be gone. flashdata not cleared - El Forum - 11-01-2009 [eluser]iFadey[/eluser] This code is from the book Professional CodeIgniter. I think you must compare the above code again with the code provided in the book. Or you can download the complete source code for the book from wrox website. Here's the link: http://www.wrox.com/WileyCDA/WroxTitle/Professional-CodeIgniter.productCd-0470282452.html flashdata not cleared - El Forum - 11-01-2009 [eluser]shinokada[/eluser] Thanks for your reply, iFadey. Yes, the code is from the book you mentioned. Can you think of anything why the flashdata does not disappear? flashdata not cleared - El Forum - 11-01-2009 [eluser]iFadey[/eluser] Okies. I looked the code in detail. The problem is simple. You are using caching here. Code: $this->output->cache(30); Actually the flashdata is removed but you have cached the page for 30 min. So it will keep showing you the old page for about 30 min. If you remove caching here, flashdata will be not be displayed again n again. Caching is very imp for performance but use it with care because sometimes it makes debugging difficult. Again I am not saying that don't use caching. Use caching but with care specially on pages which you think will not change frequently and pages which perform heavy database operations. flashdata not cleared - El Forum - 11-01-2009 [eluser]shinokada[/eluser] Thanks iFadey. Appreciate it. flashdata not cleared - El Forum - 11-01-2009 [eluser]iFadey[/eluser] Your welcome ![]() |