Could anybody brief about user_token functionality in Auth module? What is a use and how this incorporates in Auth module?
Could anybody brief about user_token functionality in Auth module? What is a use and
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is used when a user checks the ‘Remember me’ box on your site. A token is generated for the user and stored in the user_tokens table.
If you look at the Kohana_Auth_ORM class in the _login function, you can see how it is created:
It is used by the auto_login() function also in the Kohana_Auth_ORM class:
It is up to you to correctly use this capability within your authorization controller. I’m relatively new to Kohana, but I perform a simple check to redirect a user if they go to the login form and are already logged in or can automatically login:
The code for the Auth module isn’t too difficult to understand. If you’re new to Kohana, it’s a good starting point to see how the ORM module works.