Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6590895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:21:25+00:00 2026-05-25T17:21:25+00:00

I ve been developing a facebook application on Yii and after the authentication i

  • 0

I ve been developing a facebook application on Yii and after the authentication i want to set the username and id according to the facebook username and id. As i am new to Yii I dont’t have much idea about how to do it. Though when i tried to set the user id in my UserIdentity class, it gave an error saying that

Property "UserIdentity.id" is read only.

is there any other way to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:21:26+00:00Added an answer on May 25, 2026 at 5:21 pm

    What are you using for authentication now? If you set up a webapp you should have a UserIdentity class in components that extends CUserIdentity. This is usually where you would use setState(), like $this->setState('first_name', $record->first_name); to set the user’s first name from a db record after authentication, as an example, which you can retrieve via Yii::app()->user->first_name

    However, I think what you may be looking for is Yii::app()->user->name = 'newname'; which changes the CWebUser property that CUserIdentity sets during authentication with the CUserIdentity::username value.

    Either option is fine — setting a custom Yii::app()->user->value or resetting the Yii::app()->user->name value, whichever works best for your app. (I wouldn’t reset the user->id value tho.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been developing Android application where I use this code: Date d=new Date(new
I have been developing an android application for a gas station company. The application
I have been developing some software and want to give it version numbers. How
I have been developing a new online game for the past year now. The
I have been developing an application with Apache Felix as my OSGi runtime for
I have been developing a Silverlight application using WCF. The problem is that sometimes
I have been developing an application that can publish content like some sort of
I have been developing Android application, and I need to read PDF-files in my
I have been developing an Android application and testing the orientation sensor using SensorSimulator
I've been developing a Facebook app using Google App Engine in Python and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.