php - Unable to delete session at times -
i have below handle logout , display information in header show after logout. sometimes, doesn't work. suspect whether write code handle. have ideas? please help
public function logout(){ $this->nativesession->delete('user'); redirect(base_url()); }
in header section of php page:
<?php $usr = $this->nativesession->get('user'); if(!isset($usr) || empty($usr) || $usr["username"]==null) { // show login button }
logout function:
public function logout() { // removing session data $this->session->sess_destroy(); redirect('users/home'); }
add in header befor html tag:
<?php if ($this->session->userdata['admin']!='admin' ) { redirect('login'); } ?>
Comments
Post a Comment