Get User Model by PHPSESSID


flash does NOT pass the session thus we pass the id with a $_POST variable.

Yii::app()->session->sessionID = $_POST['PHPSESSID'];


I still can’t access the user model “Yii::app()->user->id”

How can I get the user model by the Session_id? I use CDbHttpSession.

best regards,


In your entry-script do this:

if (isset($_POST['PHPSESSID']))




Thanks this post was helpful. The example for the euploadify extension does not correctly load the session. Based on this thread I did the following in my index.php (entry script.)

if (isset($_REQUEST['PHPSESSID']) && strpos($_SERVER['REQUEST_URI'], 'productImage')) {

    //handle special auth case for uploadify widget using Flash



I added one extra test for a little extra security by only loading sessions from request data for certain requests.