Welcome Guest, Not a member yet? Register   Sign In
session data keeps resetting
#1

I'm struggling with a session issue so bizarre, I don't even know how to start debugging it.

I have a CI 3.0.0 project that has been up and running (and constantly being developed) for several years now.

Last week I switched to a new hosting service, and ever since then, I've been experiencing session issues, where session data keeps resetting at various intervals.

The switch to the new host was done by the hosting company - they say they copied the whole cPanel account as is, including files & database. One change I did make on the new server is defining the cookie_domain, which was previously unset, to ".mydomain.com".

When I started having problems with the sessions, I changed it back to $config['cookie_domain']  = ''; but that did not help.

my session/cookie settings in config.php are as follows:

PHP Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 14400;
$config['sess_save_path'] = 'ci_sessions3';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

$config['cookie_prefix']    '';
$config['cookie_domain']    '';
$config['cookie_path']        '/';
$config['cookie_secure']    FALSE;
$config['cookie_httponly'    FALSE

I use sessions mainly to hold user login details, and here's what I use in my basic page template, to check whether the user is logged on and has the appropriate permissions. If they do, I load the requested page view. If not, I load the login form.
What happens now is that after the user has logged on and started using the system, after a very short time, they are thrown back to the login form, as if the userdata has been somehow reset.


PHP Code:
if (!$this->session->userdata('admin_logged_in') || empty($this->session->userdata('digital_view_perms')))
    {
    $main_content 'admin_digital/login_form';
    }
  $this->load->view($main_content, @$data_rows, @$prev_code, @$action); 

Any pointers as to where I should start digging for problems would be highly appreciated!

As I said, the only thing I know for sure has changed is the hosting service. But how can that affect sessions?

Thanks!

einav
Reply


Messages In This Thread
session data keeps resetting - by einav - 03-26-2018, 07:02 AM
RE: session data keeps resetting - by php_rocs - 03-26-2018, 08:00 AM
RE: session data keeps resetting - by einav - 03-26-2018, 08:19 AM
RE: session data keeps resetting - by InsiteFX - 03-26-2018, 09:29 AM
RE: session data keeps resetting - by einav - 03-26-2018, 10:49 AM
RE: session data keeps resetting - by jreklund - 03-26-2018, 11:12 AM
RE: session data keeps resetting - by clonescloud - 03-27-2018, 02:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB