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

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -