0

I am using the Codeigniter redirect() to redirect the page after user logouts on my website http://www.theindianclassified.com.

When user goes to the url http://www.theindianclassified.com/logout he is redirected to the home page after he is logged out of the system. But if the user login and again click logout user is not logged out but he is redirected to the home page. I think the redirect using the Codeigniter redirect() method is cached by browser.

Please help me, how the implementation happen in the above scenario. I want the browser not to cache the redirect.

Log out function is below.

function logout() {
    $this->session->sess_destroy();
    redirect('');
}
Nish
  • 2,296
  • 2
  • 14
  • 19
  • Check this :: http://stackoverflow.com/questions/8616887/logout-codeigniter – Sudhir Bastakoti Jan 13 '13 at 09:20
  • please write your login and logout code. i think without code you can't expect solution. Please see @Sudhir link i think this will help you. – Syed Ahmed Jan 13 '13 at 09:58
  • added logout function. But the code works for the first time but doesn't work when logout second time. This is issue with browser cache. If I clear the browser cache it works. How to use Codeigniter redirect without being cached in browser? – Nish Jan 13 '13 at 10:09

1 Answers1

0

You should check your login function to make sure the fault isn't there. If I were to guess it'll be there. If that doesn't work try 'unsetting' the session variables one-by-one.