I’m trying to make the Auth module to ‘remember’ the user session with a checkbox on the login page. What happens is that no cookie is created, only session as usually. I’ve noticed the user_tokens table, but don’t see any use of user_token model’s methods at all. I do pass (bool) TRUE as a third parameter to login() method, but there’s no difference.
Is this feature complete at all or I have to add my own by overwritting the login() method of Model_Auth_User ?
What’s the best practice for this ?
- I also opened a topic on Kohana Forums
Answer from the Kohana forum (credit to biakavero) pasted here for reference:
Auth::instance()->login()with$remember = TRUEauthautologingenerated.Session::instance()->delete('auth_user'); // dont call logout() method as it will delete cookie & tokenAuth::instance()->auto_login()and check forAuth::instance()->get_user() // should return Model_User object