flashdata won't work with redirects - 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 won't work with redirects (/showthread.php?tid=53501) |
flashdata won't work with redirects - El Forum - 07-26-2012 [eluser]predi[/eluser] flashdata won't work with redirects even if keep_flashdata is used. Why? this is the main view class: Code: public function index() Why not working?! I'm using db for storing sessions. here's my config: Code: $config['sess_cookie_name'] = 'mysamplesess'; flashdata won't work with redirects - El Forum - 07-26-2012 [eluser]TWP Marketing[/eluser] use set_flashdata() Code: $this->session->set_flashdata('item', 'value'); flashdata won't work with redirects - El Forum - 07-28-2012 [eluser]predi[/eluser] [quote author="TWP Marketing" date="1343323633"]use set_flashdata() Code: $this->session->set_flashdata('item', 'value'); Sorry, my mistake. I was using "set_flashdata". I figured what was the problem. I've been testing the project on my localhost server, but the db i was using for session storing was on a remote server with a pretty shitty connection (3-4 sec to get mysqli connected). So as far as i'm aware now there two solutions: - do not use remote databases for session storage, use a local one (same sever) - use cookies only for sessions dunno why, will look up the "core" code to investigate that "bug" or whatever. flashdata won't work with redirects - El Forum - 07-30-2012 [eluser]TWP Marketing[/eluser] I certainly agree with avoiding the use of remote servers for db access. There are some situations where it can't be done any other way, but I don't like putting my sites at the mercy of more than one server. Hope your problem is resolved. flashdata won't work with redirects - El Forum - 08-03-2012 [eluser]Hampti[/eluser] Hi there, my experience with flashdata : when i did my first CodeIgniter project years ago flashdata worked fine. Just as i thought it was intended, and i used it a lot. Quite some time ago it stopped working correctly and the data always displayed with delay, just one request too late. I did some research and tried several "solutions", but none of them worked. So i would suggest: dont bother and use userdata instead. If you unset the userdata right after passing it to a view, it works exactly as flashdata did before. Its a pity though, and if someone could come up with why flasdata is messed up / delayed: Please tell us =). Best Regards, Constantin edit sorry, overlooked that you solved your problem and it was a different one |