Hi there,
I guess I'm going to disappointed by YUM and I have to start to write my own user management,
I want to know which way is much better to control sessions and user's data ? do I have to control them in controllers or views?
Best.
Page 1 of 1
Controlling Sessions Where? Controller Or Views?
#2
Posted 18 November 2012 - 10:51 PM
You can use session like this
Then the session data can access anywhere in your application by using this
The session data avilable in the $data variable.
$session=new CHttpSession;
$session->open();
$session['session_id']=$model->user_id;Then the session data can access anywhere in your application by using this
$session=new CHttpSession;
$session->open();
$data=$session['session_id'];The session data avilable in the $data variable.
#3
Posted 19 November 2012 - 05:02 AM
Although you can write wherever you want; the best place to write would be in the controller and filter any data you need to based on that. Don't bother to do this in views as it is clearly for presentation only.
Share this topic:
Page 1 of 1

Help












