一个session,判断用户唯一的技巧

    public function childId($value = null)
    {
        static $key = 'media_app_child_id';
        if ($value!==null) {
            $this->Session->write($key, $value);
        } else {
            $value = $this->Session->read($key);
        }
        return $value;
    }

$child_id = $this->childId($child_id);调用,如果是同一个人,获取同一个数据

posted @ 2013-04-02 15:46  linksgo2011  阅读(318)  评论(0编辑  收藏  举报