Welcome Guest, Not a member yet? Register   Sign In
session_start() error
#1

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
Reply
#2

i resolve with .env file:

app.sessionSavePath = 'session'
Reply
#3

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 !
I would change this world, but God doesn't give me the source.
Reply
#4

(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.
Reply
#5

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.
Reply
#6

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
Reply
#7

This might be perceived as a dig, sorry for that but I ran into exactly the same issue.
This time with PHP 7.2.1.

I've read on some dev site there was a PHP bug causing this around version 5.3 or so. Is it possible the PHP itself is at fault?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB