Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

User->Setstate Vs Session

$
0
0
Hi All

I want to reserve data among the user requests (like a shopping card does)

What is the difference between

Yii::app()->session['data1']='value1'  and  Yii::app()->user->setState('data1', 'value1');


what are the prons and cons and why/when use the one instead the other?

Thanks in advance

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>