CodeIgniter Forums

Full Version: session_start() error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Huh

I want initialize a session library in controller follow the instructions of the manual

$session = \Config\Services:Confusedession($config);

but, I get a error

SYSTEMPATH/Session/Session.php at line 1001
i resolve with .env file:

app.sessionSavePath = 'session'
Here is the documentation for CI3:
https://codeigniter.com/userguide3/libra...sions.html
And this for CI4:
https://codeigniter4.github.io/userguide...sions.html
Do exactly as it is described and you will succeed !
And could not would you straight for the himself code where you're trying connect to sessions and logs mistakes from directory /writable/logs/
this is necessary so that we can give a more accurate answer to your question !
(10-02-2019, 05:05 AM)Digital_Wolf Wrote: [ -> ]Here is the documentation for CI3:
https://codeigniter.com/userguide3/libra...sions.html
And this for CI4:
https://codeigniter4.github.io/userguide...sions.html
Do exactly as it is described and you will succeed !
And could not would you straight for the himself code where you're trying connect to sessions and logs mistakes from directory /writable/logs/
this is necessary so that we can give a more accurate answer to your question !

Ok,

I start a new CI4 project and uncomment last line (// $this->session = \Config\Services:Confusedession()Wink and I get the error.

I solved it with .env file: app.sessionSavePath = 'session'

thank's.
Yes, most of the session drivers require sessionSavePath to be set. This can be done in app/Config/App.php itself, or through the .env file like you've seen.
Hi,

I solve the load library, but when I try to set a session with ($this->session-set('', '')Wink I get a new error
Invalid serialization data for DateTime object#0 [internal function]: DateTime->__wakeup().

Some idea? it's possible to the problem are in the apache config for php 7.3?

thank's