I hardcoded the username and pw for testing. The user was able to login and userId = memberId. But when I refresh the page, with Yii::app()->user->login($member); uncommented, the userId becomes null and Yii::app()->user->isGuest = 1.
Am I missing something to make the log in persistent?
Why are you hard coding the user/pass when Yii ships with hardcoded values already (demo & admin remember?). The default installation has enough hardcoded values to test your login without touching the code. You should be able to login with demo/demo or admin/admin out of the box.