CakePHPのAuthComponentの履歴

cake/libs/controller/components/auth.php

    function user($key = null) {
        $this->__setDefaults();
        if (!$this->Session->check($this->sessionKey)) {
            return null;
        }

        if ($key == null) {
            $model =& $this->getModel();
            return array($model->alias => $this->Session->read($this->sessionKey));
        } else {
            $user = $this->Session->read($this->sessionKey);
            if (isset($user[$key])) {
                return $user[$key];
            }
            return null;
        }
    }