Welcome Guest, Not a member yet? Register   Sign In
fail to set flashdata after destroy session on logout
#1

(This post was last modified: 05-26-2020, 07:33 AM by nmaa3003.)

hi, 

this is my code:
PHP Code:
    public function logout()
    {
        $adminModel = new AdminModel();
        $category 'last_logout';
        $merchant $this->session->get('merchant');
        $action $merchant->email ' has logged out!';
        $adminModel->set_merchant_logs($merchant->id$category$action);

        $this->session->destroy();
        $this->session->setFlashdata('success''You have successfully logged out!');
        return redirect()->to('/merchant/login');
    

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');
Reply


Messages In This Thread
fail to set flashdata after destroy session on logout - by nmaa3003 - 05-26-2020, 07:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB