We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

After EE upgrade to v2.2.0 : Fatal error: Cannot access protected property EE_Session

Development and Programming

Gurudutt Verma's avatar
Gurudutt Verma
74 posts
14 years ago
Gurudutt Verma's avatar Gurudutt Verma

Fatal error: Cannot access protected property EE_Session

Fatal error: Cannot access protected property EE_Session::$EE in .../www/..../addons/member_timeout/ext.member_timeout.php on line 213

Call Stack:
    0.0002     686760   1. {main}() ..../www/..../index.php:0
    0.0005     766616   2. require_once('..../www/.../codeigniter/system/core/CodeIgniter.php') ..../www/..../index.php:196
    0.0090    2908296   3. CI_Controller->__construct() ..../www/..../codeigniter/system/core/CodeIgniter.php:281
    0.0102    3316808   4. CI_Loader->ci_autoloader() ..../www/..../codeigniter/system/core/Controller.php:51
    0.0104    3327656   5. EE_Loader->library() ..../www/..../codeigniter/system/core/Loader.php:1047
    0.0104    3327816   6. CI_Loader->library() ..../www/..../expressionengine/core/EE_Loader.php:138
    0.0104    3327816   7. CI_Loader->_ci_load_class() ..../www/..../codeigniter/system/core/Loader.php:138
    0.0114    3642288   8. CI_Loader->_ci_init_class() ..../www/..../codeigniter/system/core/Loader.php:873
    0.0114    3643792   9. EE_Core->__construct() ..../www/..../codeigniter/system/core/Loader.php:972
    0.0114    3643792  10. EE_Core->_initialize_core() ..../www/..../expressionengine/libraries/Core.php:36
    0.0228    7063688  11. EE_Loader->library() ..../www/..../expressionengine/libraries/Core.php:231
    0.0228    7063848  12. CI_Loader->library() ..../www/..../expressionengine/core/EE_Loader.php:138
    0.0228    7063848  13. CI_Loader->_ci_load_class() ..../www/..../codeigniter/system/core/Loader.php:138
    0.0243    7595272  14. CI_Loader->_ci_init_class() ..../www/..../codeigniter/system/core/Loader.php:873
    0.0244    7602632  15. EE_Session->__construct() ..../www/..../codeigniter/system/core/Loader.php:968
    0.0451   10386016  16. EE_Extensions->universal_call() ..../www/..../expressionengine/libraries/Session.php:261
    0.0456   10485504  17. call_user_func_array() ..../www/..../expressionengine/libraries/Extensions.php:260
    0.0456   10486072  18. Member_timeout_ext->on_sessions_end() ..../www/..../expressionengine/libraries/Extensions.php:0
    0.0456   10486152  19. Member_timeout_ext->update_cookies() ..../www/..../addons/member_timeout/ext.member_timeout.php:141

The code line at 213 in ext.member_timeout.php is

$session->EE->input->cookie($c_expire)

This

$session

variable comes via hook “sessions_end”: http://expressionengine.com/developers/extension_hooks/sessions_end/

$edata = $EXT->call_extension('sessions_end', $this);
if ($EXT->end_script === TRUE) return;

After looking in deep I found that : “/…../www/….expressionengine/libraries/Session.php” Introduce new line of code :

protected $EE;

This is not allowing to access protected area part and resulting error.

I am not sure if we remove this “protected” code and it can be security concern ?

Let me know if there is any other workaround here.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
14 years ago
John Henry Donovan's avatar John Henry Donovan

Hi Gurudutt ,

Is this an extension you wrote yourself?

Can you share it fully and explain what you use it for please?

Moving to development forum as more appropriate there

Take a look here at notes for developers for EE2.2+

       
Gurudutt Verma's avatar
Gurudutt Verma
74 posts
14 years ago
Gurudutt Verma's avatar Gurudutt Verma

Hi John Henry Donovan,

I noticed “ExpressionEngine 2.2, Add-on Developer Preview” yesterday.

We are getting this issue several places in our site after upgrade, basically all issues with our own modules.

I am fixing it one by one with some workaround.

I will get back with more explanation about this particular issue.

       
Gurudutt Verma's avatar
Gurudutt Verma
74 posts
14 years ago
Gurudutt Verma's avatar Gurudutt Verma

I guess this thread can be closed

Since we have copied procedure “update_cookies($session,$pass=NULL)” from Session.php to set member session expiration timeout.

I just recopied the whole procedure and changed the expiration time and it works now.

Thank you for your help.

btw : this new way of working is breaking our site many places and I am fixing it one by one but we have to really test our whole site properly before upgrading our production environment 😊

I will get back again if I need help in this regard.

Thank you 😊

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
14 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team
Since we have copied procedure “update_cookies($session,$pass=NULL)” from Session.php to set member session expiration timeout.

If you’re just changing the session timeout you could probably use this new feature from 2.2.0:

Added Config Overrides (user_session_ttl and cp_session_ttl) to allow site developers the ability to change the default user and control panel session TTL.

The config overrides are:

$config['user_session_ttl']
$config['cp_session_ttl']
       
Gurudutt Verma's avatar
Gurudutt Verma
74 posts
14 years ago
Gurudutt Verma's avatar Gurudutt Verma

Thank you Erik for suggestion,

Now I have almost fixed all our protected/private issue and our site is working properly.

I will try your suggestion and after testing, I will delete our dependent code.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.