0
votes

i have a account_activation controller in codeigniter which changes values in the user database and SHOULD unset the session and destroy the session in my ci_sessions database.

looks like this

function account_activation (){

  //blablabla database stuff

  $the_results['message'] = "Dein Account wurde erfolgreich aktiviert";
  $this->session->sess_destroy();
  $this->layout->render_page('/Startseite/aktivierung', $the_results);
}

and im getting redirected to Startseite/aktiverung/ and can see my userdata is unset, and the session is destroyed (i print my userdata/session in the header for monitoring). AND if i now click back on the home button, all my userdata is back, for example system_login == true although i saw it was gone on the previous page.

im working on this for hours and im really frustrated..please tell me im making some logical fault on this ;)

regards, philipp

1

1 Answers

2
votes

I've heard a couple of times that some has experienced similar problems. What they did to solve this problem was setting the session data to empty values.

Like

function account_activation (){

  //blablabla database stuff

  $the_results['message'] = "Dein Account wurde erfolgreich aktiviert";
  $this->session->set_userdata('user_id', 0);
  $this->layout->render_page('/Startseite/aktivierung', $the_results);
}

And then validate the user for every page load.