• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fail to set flashdata after destroy session on logout

#1
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.