Welcome Guest, Not a member yet? Register   Sign In
How can I resume the session?
#1

(This post was last modified: 10-30-2019, 10:47 PM by Navindex.)

I'm using session data to save and restore multi-page form data in CI4 (rc3). PHP version is 7.2.24.

It works very well when I use the conventional PHP-way with $_SESSION and session_start().
However, when I try to do the same with CI4, it creates a new session instead of resuming the existing one.

The environment settings are:

Code:
app.sessionDriver             = 'CodeIgniter\Session\Handlers\FileHandler'
app.sessionCookieName         = 'my_session_cookie_'
app.sessionExpiration         = 7200
app.sessionMatchIP            = false
app.sessionTimeToUpdate       = 300
app.sessionRegenerateDestroy  = false

This happens every time when I initialize the session ( $session = session(); ) on a new page. I would expect it resumes the existing session, however, a new cookie is created.

Quote:my_session_cookie_9u6ahqoi6i3io93g1gtmekpegcou0gml
my_session_cookie_aom9vnrvjjpkn12l1hl7j3a716ing9sf
my_session_cookie_hvm0gcvjd7i7avu64aksv8udn25fcsio
my_session_cookie_ra9qb2kqp40psju6up7ff13tflsbgvfq
my_session_cookie_v0g6g81g71vrja5cb63cglue7j0shrj2

These files contain session data of a single page only.

Is this a bug or I'm missing something here? When I switch back to PHP's session_start(), it resumes the session correctly.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB