public function remember($user = NULL)
{
if (is_null($user)) {
$user = $this->get_user();
}
if (!$user) {
return FALSE;
}
// Create a new autologin token
$token = ORM::factory('user_token');
// Set token data
$token->user_id = $user->id;
$token->expires = time() + $this->_config['lifetime'];
$token->save();
// Set the autologin cookie
Cookie::set($this->_config['autologin_key'], $token->token, $this->_config['lifetime']);
return TRUE;
}