CodeIgniter Forums
CodeIgniter\\Session\\Session and Psr\\Log\\LoggerAwareTrait define the same property - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: CodeIgniter\\Session\\Session and Psr\\Log\\LoggerAwareTrait define the same property (/showthread.php?tid=83487)



CodeIgniter\\Session\\Session and Psr\\Log\\LoggerAwareTrait define the same property - dennz.liu - 09-29-2022

Could anyone help me fix this error ?
<br />

Code:
<b>Fatal error</b>:  CodeIgniter\Session\Session and Psr\Log\LoggerAwareTrait define the same property ($logger) in the composition of CodeIgniter\Session\Session. However, the definition differs and is considered incompatible. Class was composed in <b>C:\inetpub\vhosts\testing.id\httpdocs\testing\system\Session\Session.php</b> on line <b>31</b><br />

{
    "title": "ErrorException",
    "type": "ErrorException",
    "code": 500,
    "message": "CodeIgniter\\Session\\Session and Psr\\Log\\LoggerAwareTrait define the same property ($logger) in the composition of CodeIgniter\\Session\\Session. However, the definition differs and is considered incompatible. Class was composed",
    "file": "C:\\inetpub\\vhosts\\testing.id\\httpdocs\\testing\\system\\Session\\Session.php",
    "line": 31,
    "trace": [
        {
            "function": "shutdownHandler",
            "class": "CodeIgniter\\Debug\\Exceptions",
            "type": "->"
        }
    ]
}
This happen when I try to init session inside model file in construct :


Code:
 User extends Model {


    protected $session;


    function __construct()
    {      
       $this->session = session();
        include APPPATH . 'ThirdParty/vendor/autoload.php';           
    }



RE: CodeIgniter\\Session\\Session and Psr\\Log\\LoggerAwareTrait define the same property - paulbalandan - 10-06-2022

Hi! Can you show us the output of
Code:
composer info -D