how can i use session variables in my controllers? do i need some specific helper, or component?
i need to use some of Auth defined variables, like
$session->read('Auth.User.user_type_id')
… etc.
tnx in adv!
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.
When using Sessions in your Controller, you can access this info via the Session Component. The component will setup the abstraction layer and make it available to the rest of the application. If you need to use the Session in your Views, you will also need to include the Session Helper.
The Auth component automatically uses the session if configured as such. You can see what is available in the Session data by using
debug($this->Session->read());.