Reputation: 7042
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 ?
Upvotes: 2
Views: 1344
Reputation: 28526
Answer from the Kohana forum (credit to biakavero) pasted here for reference:
Auth::instance()->login()
with $remember = TRUE
authautologin
generated.Session::instance()->delete('auth_user'); // dont call logout() method as it will delete cookie & token
Auth::instance()->auto_login()
and check for Auth::instance()->get_user() // should return Model_User object
Upvotes: 3