please help me with sessions

on my index page, i need to store a session variable, because I am redirecting users with a fb connect

I dont know much about sessions,

how do i start a session (without logging a user in)

and save vars?

then access these when the redirect occurs

please help!


i think that basically, Yii::app()->session[‘yourVarName’] is what you need

i’m using this method to count hits on a page:


	public function actionIndex()



		    Yii::app()->session['ic'] = 1;

		    Counter::model()->updateCounters(array('counterCount' => 1), 'counterId = :id', array(':id' => 1));




so, the code to store session var:

    Yii::app()->session['ic'] = 1;

and to retrieve the value

    $anyVar = Yii::app()->session['ic']

hope it helps!



You can also use the properties of CUser, they are saved in the session.