开发者

How to use session defined variables in controller?

开发者 https://www.devze.com 2023-01-09 11:21 出处:网络
how can i use session variables in my contr开发者_如何转开发ollers? do i need some specific helper, or component?

how can i use session variables in my contr开发者_如何转开发ollers? 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!


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());.

0

精彩评论

暂无评论...
验证码 换一张
取 消