Welcome Guest, Not a member yet? Register   Sign In
Remember me (Community Auth)
#1

What's the proper way to enable or make the remember me feature in Community-Auth work properly?

Because currently it's working whether I ticked the check box or not.

Thanks in advance.
Reply
#2

Hey, it's been a long time since I looked at it, but if I remember correctly the Remember Me feature is meant for configuration where your normal CI session config is set to a short expiration (but not 0). Honestly, I'd need to dig through code to give you a good answer, and I don't have the time today. I'll get back to you on this.
Reply
#3

OK, sorry for the delay. If you look at the provided MY_Session.php, you'll see it's quite a simple alteration to the way sessions normally work:


PHP Code:
/**
 * Begin modification for remember me ---------------------------
 */
$CI =& get_instance();

// If on login the user chose the remember me option, or already has the cookie
$remember_me = ( 
    $CI->input->post('remember_me') OR 
    isset$_COOKIE$CI->config->item('remember_me_cookie_name') ] ) 
) ? 
TRUE FALSE;

if( 
$CI->config->item('allow_remember_me') && $remember_me )
{
    $params['cookie_lifetime'] = $CI->config->item('remember_me_expiration');
}
/**
 * End modification for remember me ------------------------------ 


The only thing I imagine could be a problem for you is if the cookie is still hanging around for some reason. It should be deleted when you log out. If your session is set to expire with something other than 0 that would also provide a "remember me" type login, but probably only for two hours, unless you've customized the value. If you need any other help, please provide your current session config.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB