Flashdata clearing after redirect - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Flashdata clearing after redirect (/showthread.php?tid=84597) |
Flashdata clearing after redirect - Thiaxl - 10-24-2022 Hello, Flashdata is clearing up after I do the redirect. My code: PHP Code: public function deleteGroup() But if I remove the redirect and return a view, it works correctly: PHP Code: public function deleteGroup() What am I doing wrong? RE: Flashdata clearing after redirect - superior - 10-24-2022 Why not just: return redirect()->to('groups')->with('success', 'Grupo remivido com sucesso'); RE: Flashdata clearing after redirect - Thiaxl - 10-24-2022 (10-24-2022, 08:00 AM)superior Wrote: Why not just: return redirect()->to('groups')->with('success', 'Grupo remivido com sucesso'); Hello. Not Working yet. Redirect clean the flash data. RE: Flashdata clearing after redirect - doitlikejustin - 10-24-2022 You can append "->withCookies()" to the end of your redirect. PHP Code: public function deleteGroup() RE: Flashdata clearing after redirect - kenjis - 10-24-2022 (10-24-2022, 07:11 AM)Thiaxl Wrote: Flashdata is clearing up after I do the redirect. How did you know that? I think redirect() dose not clear session data. RE: Flashdata clearing after redirect - HermyC - 10-24-2022 (10-24-2022, 07:11 AM)Thiaxl Wrote: Hello, Typo? 'group' or 'groups'? RE: Flashdata clearing after redirect - InsiteFX - 10-25-2022 What happens if you use: PHP Code: $session->keepFlashdata('item'); |