Welcome Guest, Not a member yet? Register   Sign In
Session will not persists in CI 3.1.11 with CI Rest Api, no matter what I do
#1

I cannot get my session to persist past the login.

I can see the session data in the sessions folder, the variables are saved. When a user logs in I am saving their user id and company id in the session.

But once I navigate to another page in my ReactJS project, and do another ajax call, the CI Rest API just returns unauthorized. The session token also changes.

I noticed this bug when I went from 3.1.10 to 3.1.11. But I am not honestly sure what is causing it and what to do.

I have spent 4 hours reading blogs and forums trying all the suggestions I could find and understand; nothing is resolving this.

$config['sess_driver'= 'files';
$config['sess_cookie_name'= 'ci_session';
$config['sess_expiration'= 7200;
$config['sess_save_path'= APPPATH . 'sessions';
$config['sess_match_ip'= FALSE;
$config['sess_time_to_update'= 300;
$config['sess_regenerate_destroy'= FALSE;


$config['cookie_prefix']    = '';
$config['cookie_domain']    = '.localhost:4011';  // running dev project on my laptop
$config['cookie_path']      = '/';
$config['cookie_secure']    = FALSE;
$config['cookie_httponly']  = FALSE;


Yes I have sessions autoloaded.

This was all working and then it just stopped after 3.1.11.
Reply


Messages In This Thread
Session will not persists in CI 3.1.11 with CI Rest Api, no matter what I do - by deltatangodt - 01-12-2020, 04:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB