CI3 Session Not Expiring On Browser Close |
Hi guys,
Using Codeigniter 3.1.2. Below are my config details for session. PHP Code: $config['sess_driver'] = 'database'; I am told that upon setting the sess_expiration to 0 that it would be destroyed upon browser close. However, this does not seem to happen. Any idea? Any method I can use to utilise this? Using javascript seems not practical since it gets triggered when used the back button and when going to a different URL.
It is possible if you change the sess_time_to_update with 1 day (means session destroy after 24 hour)
You can try this but make sure you clear your browsers cache before testing it again.
ini_set('session.cookie_lifetime', 0); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thank you for the reply.
I added your code to the constructor of the of the default controller. PHP Code: public function __construct() But it still seems to have no effect. Any idea why? |
Welcome Guest, Not a member yet? Register Sign In |