![]() |
fail to set flashdata after destroy session on logout - 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: fail to set flashdata after destroy session on logout (/showthread.php?tid=76563) |
fail to set flashdata after destroy session on logout - nmaa3003 - 05-26-2020 hi, this is my code: PHP Code: public function logout() so, notice that i setFlashdata after session destroy. it's not triggering the flashdata when redirected to login page. was that intentional or was that a bug? Thanks. just found solution, just use $this->session->remove('merchant'); RE: fail to set flashdata after destroy session on logout - Halim - 11-09-2021 I have the same problem ![]() RE: fail to set flashdata after destroy session on logout - mr.t1000 - 11-09-2021 I think you could also do: return redirect()->to('/merchant/login')->withCookies(); RE: fail to set flashdata after destroy session on logout - donpwinston - 11-09-2021 (11-09-2021, 10:05 AM)Halim Wrote: I have the same problem The session is destroyed. There is no place to put the flash data. The session is not created again until the controller class that creates the next page is executed which is after the set flash data statement. |