Get/Post Data
Yii: APP ()-> request-> getparam ('id'); # $ _ Get ['id'] or $ _ post ['id']
Session/cookie
$ _ Session is equivalent to yii: APP ()-> session;
// Start the session
$ Session = new chttpsession;
$ Session-> open ();
Write session
Yii: APP ()-> session ['key'] = 'value ';
Read session
Yii: APP ()-> session ['key']
Get sessionid
Yii: APP ()-> session-> sessionid
Destroy session
Yii: APP ()-> session-> clear ();
Yii: app-> session-> destory ();
2.2.1 set cookie
$ Cookie = new chttpcookie ('mycooker', 'This is my cooker ');
$ Cookie-> expire = Time () + 60*60*24*30; // there is a deadline of 30 days
Yii: APP ()-> request-> Cookies ['mycookier'] = $ cookie;
2.2.2 reading cookies
$ Cookie = yii: APP ()-> request-> getcookies ();
Echo $ cookie ['mycooker']-> value;
2.2.3 destroy cookie
$ Cookie = yii: APP ()-> request-> getcookies ();
Unset ($ cookie [$ name]);