Get User Model by PHPSESSID

Hi,

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


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

	Yii::app()->session->init();

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,

peili

In your entry-script do this:




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

{

   $_COOKIE['PHPSESSID'] = $_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

    $_COOKIE['PHPSESSID'] = $_REQUEST['PHPSESSID'];

}



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