request->getVar('username'); $password = $this->request->getVar('password'); $param = array('name' => $uname, 'passwd' => $password); $data = $model->cekuser($param)->getRowArray(); // var_dump($data); //exit(); if ($data) { $ses_data = [ 'nip' => $data['NIP9'], 'nama' => $data['NAMA'], 'kppadm' => $data['KPPADM'], 'jabatan' => $data['NAMA_JABATAN'], 'kantor' => $data['NAMA_KANTOR'], 'seksi' => $data['NAMA_UNIT_ES3'] ]; $session->set($ses_data); return redirect()->to(base_url('Home')); } else { //print_r('user tidak ada'); //exit; $session->setFlashdata('msg', 'User Tidak ada'); return redirect()->to('auth'); } } public function logout() { $session = session(); $session->destroy(); return redirect()->to('auth'); } }