CodeIgniter Forums
how to delete session histroy?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: how to delete session histroy?? (/showthread.php?tid=32493)



how to delete session histroy?? - El Forum - 07-25-2010

[eluser]Unknown[/eluser]
Hi guys,


I'm coding a simple login system it working good except in one thing, which is user profile could be accessed after logging out by clicking back button of the browser.

I've made sure that the session destroyed, but I couldn't solve it. So, how to erase the logged history by the browser.


Any help appreciated.

Thanks guys


how to delete session histroy?? - El Forum - 07-25-2010

[eluser]Prophet[/eluser]
You can unset the userdata to be sure that everything is deleted:
Code:
$this->session->unset_userdata('userdata_name');

Usually $this->session->sess_destroy(); is enough to do it though.


how to delete session histroy?? - El Forum - 07-26-2010

[eluser]arthurhanlon[/eluser]
The same thing happens to me too.

When my user logs out and hits the back button they are put back into the admin section of my application. The only way that you can know if you are logged out is to try to visit another page within the admin section or press F5 THEN it'll tell you you are not logged in.

Have I missed a setting somewhere like caching that would allow this type of functionality?

Cheers,
Arthur


how to delete session histroy?? - El Forum - 07-26-2010

[eluser]WanWizard[/eluser]
The only way to prevent a back button to stop working is to tell the browser not to cache the page in the http header. And even that is not fool proof.

I shouldn't focus to much on that. If your application is properly written, any action the user performs on that admin page after using the back button should detect that the user is no longer logged in, and should take appropriate action.