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

  • Home
  • SEARCH
  • 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 8108661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:11:03+00:00 2026-06-06T01:11:03+00:00

I am trying to know if a user is guest using Yii::app()->user->isGuest but I

  • 0

I am trying to know if a user is guest using Yii::app()->user->isGuest but I get the following notice:

Undefined property: CWebApplication::$user

Apparently the component user is not yet defined in the application, I would like to know the reason.

I had tried to check if the component is avalible via

if(isset(Yii::app()->user))

However it fails ¿How can I check if the user is a guest even when Yii::app()->user is not defined?¿Should I get this notice when using isGuest?

EDIT: I changed error_reporting directive to “E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT” I needed to move forward. Now I got this fatal error:

Fatal error: Call to a member function getId() on a non-object in home/mario/projects/ciudad_wiki/yii/framework/web/auth/CWebUser.php on line 530

No Time Memory Function Location

  1. 0.0005 235120 {main}( ) ../index.php:0
  2. 0.0207 1548168 CApplication->run( ) ../index.php:13
  3. 0.0207 1548352 CWebApplication->processRequest( ) ../CApplication.php:162
  4. 0.0235 1725768 CWebApplication->runController( ) ../CWebApplication.php:135
  5. 0.0272 2103464 CController->run( ) ../CWebApplication.php:276
  6. 0.0279 2145872 CController->runActionWithFilters( ) ../CController.php:266
  7. 0.0279 2145984 CController->runAction( ) ../CController.php:287
  8. 0.0279 2146128 CInlineAction->runWithParams( ) ../CController.php:309
  9. 0.0279 2146688 SiteController->actionIndex( ) ../CInlineAction.php:50
  10. 0.0529 3875888 CController->render( ) ../SiteController.php:33
  11. 0.0529 3876112 CController->renderPartial( ) ../CController.php:783
  12. 0.0532 3877352 CBaseController->renderFile( ) ../CController.php:870
  13. 0.0532 3877672 CBaseController->renderInternal( ) ../CBaseController.php:96
  14. 0.0539 3918144 require( foo_dir/protected/views/site/index.php’ ) ../CBaseController.php:127
  15. 0.0705 4428584 CModule->__get( ) ../CBaseController.php:199
  16. 0.0705 4428584 CModule->getComponent( ) ../CModule.php:104
  17. 0.0723 4580360 CWebUser->init( ) ../CModule.php:388
  18. 0.0736 4671144 CWebUser->getIsGuest( ) ../CWebUser.php:195
  19. 0.0736 4671240 CWebUser->getState( ) ../CWebUser.php:279
  20. 0.0736 4671320 CWebUser->getStateKeyPrefix( ) ../CWebUser.php:557

The trace is similar to the last one, Yii can’t find anything in $_SESSION related to user component.

EDIT #2: I uploaded the trace with E_NOTICE on, here it is:
PHP notice

EDIT #3: I updated php to 5.4 recently. When I run the application in a server with php 5.3 there is no problem, maybe there is a notice behind the scenes but not the fatal error I get with php 5.4. As bool.dev wrote: this is a complete guess.

  • 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-06-06T01:11:07+00:00Added an answer on June 6, 2026 at 1:11 am

    Sorry, I ran a massive replacent that corrupted the framework. I realized the problem was yii directory because I don’t track it with git, when I set up a new production environment, in a virtual machine, everything was fine again and the only difference was the framework directory. Thanks for you help.

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

Sidebar

Related Questions

I am trying to create a trapezoid using user inputted options. I know my
I know this might be a bit awkward but I am trying to modify
I know this is really dumb but I'm trying to find the advanced settings
I know I could code what I'm trying to achieve, but I'd like to
I am basically trying to get a user to input a hexadecimal input via
I'm trying to find examples on how to get real time updates using a
I'm trying to write a two-user tic tac toe using JSF technology. From the
What I'm trying to do is set role to user for all users, but
Using PHP and MySQL, I'm trying to get all the private chats involving the
I was trying to know how // and can be passed into a macro

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.