简体   繁体   中英

CakePhp Auth session data: dot notation not working

If I add the following code to a controller action and visit it:

debug($this->Session->read('Auth.User'));

If see the following printed:

array(
    'User' => array(
        'password' => '*****',
        'username' => 'admin'
    )
)

But if I try and access the 'username' using dot notation:

debug($this->Session->read('Auth.User.username'));

It returns null.

What am I missing here?

尝试此debug($this->Session->read('Auth.User.User.username'));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM