strange thing... have exactly the same problem here: it looks like, new user session information/variables are lost after using redirect .. if they are stored in the same action before redirecting.
I'm searching my source code since hours without success and now I find this post which absolutely fits my problem.
I'm writing data to an user session variables using
Followed by an redirect
In round about 1 of 5 cases the new stored session informations are lost.
This problem mostly exists by using CCacheHttpSession and CDbHttpSession.
Is it possible/planned to change the Yii-redirect-code, (for example) like tybetx wrote... in order to close the session before executing the redirect?!
Thank you, rall0r.
While investigating this problem and playing around with Yii::app()->session->close(); I found out, that not only redirect is the problem.
In my case also the following happend:
1.) the user submits an Form with ajaxSubmitButton
2.) the ajax action runs Yii::app()->user->setState() to set an session variable
3.) the ajax action ends with Yii::app()->end();
4.) the 'success' event from the ajaxSubmitButton starts and loads data from the server...
...and does not find the content from "2.)"