CodeIgniter Forums
Session Unset - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Session Unset (/showthread.php?tid=24638)



Session Unset - El Forum - 11-15-2009

[eluser]The Casual Bot[/eluser]
Hey Guys

iv tried and tried but cant get it to work



Code:
$i = 1;
     echo $i;
     echo '<pre>';
     while ($i <= $data['personalnumber']) {

      $this->app = $this->load->database('default', TRUE);
      print_r ($this->session->userdata($i));
      $this->session->unset_userdata($i);
      print_r ($this->session->userdata($i));
      $i = $i + 1;
      echo $i;
        }
      echo '</pre>';

I can unset if i change $i to say '1' which at the first loop $i == 1 but it will not clear the session data id i pass it a variable

as you can see from my code i have tried to resolve this
but it gives no error and leaves the data in the session

Any Ideas

Thanks
AJ


Session Unset - El Forum - 11-15-2009

[eluser]The Casual Bot[/eluser]
it's OK

iv fixed it

i had to pass in an array (as it said in the user guide) *tut*

Smile

Thanks

Aj