Welcome Guest, Not a member yet? Register   Sign In
Ajax requests destroys flashdata
#2

[eluser]BrianDHall[/eluser]
As far as I am aware this is just one of the weaknesses of flash data.

One way to handle it, which is basically a hack but it would work just fine for your use if you are already rather heavily invested into using flashdata, is a custom function you set that would foreach through every flashdata variable and set it again as a flash variable - you would call this function whenever you wanted to preserve your variables.

The other, far easier, option is just use regular session variables and manually unset them when you are done with them (so if X message printed to browser, unset message X... etc). Or if you don't really care when the variable dies, let the garbage collector handle it for you Smile

I would definately suggest the latter as the 'best way', as I don't believe there is any "ignore this request as far as flashdata goes" option built into codeigniter, though it wouldn't necessarily be a bad option.


Messages In This Thread
Ajax requests destroys flashdata - by El Forum - 09-21-2009, 01:44 PM
Ajax requests destroys flashdata - by El Forum - 09-21-2009, 03:54 PM
Ajax requests destroys flashdata - by El Forum - 07-27-2010, 12:47 AM
Ajax requests destroys flashdata - by El Forum - 01-27-2011, 04:38 PM
Ajax requests destroys flashdata - by El Forum - 01-27-2011, 04:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB