Welcome Guest, Not a member yet? Register   Sign In
Session problem
#1

I to all.
I have a problem with the session variable. When I try to access to it I get this error. The session file is created correctly but I can do nothing.

Code:
Fatal error: Uncaught ErrorException: print_r(): Property access is not allowed yet in /mnt/data/Workspace/mysite/system/Log/Logger.php:463 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'print_r(): Prop...', '/mnt/data/Works...', 463, Array) #1 /mnt/data/Workspace/mysite/system/Log/Logger.php(463): print_r(Array, true) #2 /mnt/data/Workspace/mysite/system/Log/Logger.php(347): CodeIgniter\Log\Logger->interpolate('print_r(): Prop...', Array) #3 /mnt/data/Workspace/mysite/system/Common.php(756): CodeIgniter\Log\Logger->log('critical', 'print_r(): Prop...', Array) #4 /mnt/data/Workspace/mysite/system/Debug/Exceptions.php(156): log_message('critical', 'print_r(): Prop...', Array) #5 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #6 {main} thrown in /mnt/data/Workspace/mysite/system/Log/Logger.php on line 463

Fatal error: Uncaught ErrorException: print_r(): Property access is not allowed yet in /mnt/data/Workspace/mysite/system/Log/Logger.php:463 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'print_r(): Prop...', '/mnt/data/Works...', 463, Array) #1 /mnt/data/Workspace/mysite/system/Log/Logger.php(463): print_r(Array, true) #2 /mnt/data/Workspace/mysite/system/Log/Logger.php(347): CodeIgniter\Log\Logger->interpolate('Uncaught ErrorE...', Array) #3 /mnt/data/Workspace/mysite/system/Common.php(756): CodeIgniter\Log\Logger->log('critical', 'Uncaught ErrorE...', Array) #4 /mnt/data/Workspace/mysite/system/Debug/Exceptions.php(156): log_message('critical', 'Uncaught ErrorE...', Array) #5 /mnt/data/Workspace/mysite/system/Debug/Exceptions.php(224): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #6 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler() #7 {main} thrown in /mnt/data/Workspace/mysite/system/Log/Logger.php on line 463


Thanks to all in advance, if more informations are needed let me know.
Reply
#2

(This post was last modified: 08-19-2020, 11:44 PM by luna80.)

The problem happen if in my .env I have

Code:
CI_ENVIRONMENT = development

If I set CI_ENVIRONEMENT to production the set of the session works but not unset.

How can I solve it?

Thanks
Reply
#3

In what way are you trying to access it? We need to see some code to be able to help you.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

I use this

to set
Code:
$this->session->set('utente', $utente);

to read
Code:
$this->session->get('utente')

but 

Code:
print_r($this->session->get());

return only
Code:
Array ( [__ci_last_regenerate] => 1598244195 )
Reply
#5

What version of CodeIgniter are you running?

You can get the developer version here that is always more up to date.

CodeIgniter 4 Developement Branch
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

So, looking at the source code of Logger we see this:

PHP Code:
if (isset($_SESSION))
{
    
$replace['{session_vars}'] = '$_SESSION: ' print_r($_SESSIONtrue);



So my question to you is, what values are you putting into the session and what values where in it before? This might be important.
Reply
#7

Thanks a lot to all, I solved my problem by using the development branch as suggested by InsiteFX...I don't know if my problem was a bug or not but I didn't have more time to indagate.
If I'll some time I'll try to undestand the problem and I'll update this discussion in case someone has the same problem.

Many thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB