fire
(Fire)
1
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!
hey!
i think that basically, Yii::app()->session[‘yourVarName’] is what you need
i’m using this method to count hits on a page:
controllers/SiteController.php:
public function actionIndex()
{
if(!isset(Yii::app()->session['ic'])){
Yii::app()->session['ic'] = 1;
Counter::model()->updateCounters(array('counterCount' => 1), 'counterId = :id', array(':id' => 1));
}
$this->render('index');
}
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!
regards!!

zaccaria
(Matteo Falsitta)
3
You can also use the properties of CUser, they are saved in the session.