![]() |
Flashdata delayed - 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 delayed (/showthread.php?tid=50370) |
Flashdata delayed - El Forum - 03-24-2012 [eluser]fry.fr[/eluser] Hello! I'm using Codeigniter for a while now and got into a problem I just can't find a solution for. The application I'm working on uses Flashdata to display error messages to the user. Here is the code example: Code: $info_message['type'] = 'error'; On the "groups" page the error message should be displayed, but it's not there. If a browser refresh is performed, the message appears. This error occurs often, but not always, sometimes the message appears as expected without the manual browser refresh. It seems to have a connection to the page loading speed, if the page loads instantly the error message is not there, if the page loads last a few milliseconds the flashdata message is there on the first request. As you can see I'm using the redirect, so there should be a new request. Using redirect('groups', 'refresh') does not change this behaviour. Thanks for your help. Flashdata delayed - El Forum - 03-24-2012 [eluser]InsiteFX[/eluser] Try this: Code: redirect('groups', 'refresh'); Flashdata delayed - El Forum - 03-24-2012 [eluser]PhilTem[/eluser] Maybe it's a browser cache issue? Have you tried setting the page's header to tell the browser to not cache the content? Flashdata delayed - El Forum - 03-24-2012 [eluser]fry.fr[/eluser] [quote author="InsiteFX" date="1332609487"]Try this: Code: redirect('groups', 'refresh'); Already tried this, didn't change anything. Flashdata delayed - El Forum - 03-24-2012 [eluser]fry.fr[/eluser] [quote author="PhilTem" date="1332610129"]Maybe it's a browser cache issue? Have you tried setting the page's header to tell the browser to not cache the content?[/quote] Is there a way to do it wiht codeigniter? or via htaccess? Flashdata delayed - El Forum - 03-24-2012 [eluser]InsiteFX[/eluser] Try keep_flashdata Code: $this->output->set_header("HTTP/1.0 200 OK"); Flashdata delayed - El Forum - 03-24-2012 [eluser]fry.fr[/eluser] [quote author="InsiteFX" date="1332611257"]Try keep_flashdata Code: $this->output->set_header("HTTP/1.0 200 OK"); Thanks for the header code. keep_flashdata can't help me in this case because the actual flashdata is not lost. It's send with the next request, but sometimes a litte too late. Flashdata delayed - El Forum - 03-24-2012 [eluser]fry.fr[/eluser] I also didn't experiance this error with wired dsl connections, just with the wireless 3g connection I use when traveling... maybe it's a really a problem with the cache or something. |