Are you experencing session problem with codeigniter 1.7.1?

It’s been a while i have been posted any thing on blog. I have been quite busy with my works, as i am using codeigniter for my current PHP project. We know that session.php comes with the codigniter is not good enough to handle session properly. If you already using it you may be experienced a problem of session still continue even if you close browser and reopen it again. Also remember me check box wont work.

After looking into forums i got a solution regarding it. I have added $sess_persistent_cookie variable into session.php and also write up a function to set it. This persistent cookie var will be responsible to work with remember me option. We have to just execute $this->session->sess_persistent_cookie(true) to enable remember me option. Also do not forgot to add this line to config.php of yours.

$config[‘sess_persistant_cookie’]     = TRUE;

You can download Session.php with this post. Anyone can use it with their own risk (nothing much to worry about it).  It will work like a charm :).

If any query just comment here.

Leave a Reply