Welcome Guest, Not a member yet? Register   Sign In
Session Auto Logout
#1

[eluser]mdavis1982[/eluser]
Hi all...

I am so near to getting my first CI project live it's scary! I just hope it lives up to the expectations I have because the site is going to be pushing some serious bandwidth (it's a redesign of an existing site with eCommerce / Digital Downloads / User Accounts etc).

The final problem I have is with the built-in session class. I need it to automatically log my users out... Either when they close the browser (preferable) or after a set number of minutes (not too bad).

I've done this in the config file:

Code:
$config['sess_expiration']    = 900;

But even after the 15 minutes has lapsed, I still appear to be logged in. How can I achieve what I'm trying to do?

Thanks...

Matt
#2

[eluser]systemsos[/eluser]
I'm not "quite" sure how the sess_expiration works with CI's session library - but I imagine it would be similar to my own library that I wrote up for RA_Session (using native PHP sessions).

If you have the sess_expiration set to '0' - it will log (kill) out the session as soon as the browser is closed.

http://codeigniter.com/wiki/RA_session/ If you have no luck with the included library from CI.

Hope this helps
Cheers,
#3

[eluser]mdavis1982[/eluser]
Thanks for that... I'll give it a try!

Matt




Theme © iAndrew 2016 - Forum software by © MyBB