Welcome Guest, Not a member yet? Register   Sign In
Sessions - Not Working
#1

(This post was last modified: 07-02-2015, 09:24 AM by iD30.)

Hi All

I have recently updated form 2.2.x to 3.0.0 - following the update procedure from codeigniter's website HERE.

I have having real issues with the new session library - heres the issue.

We have a login section which dependant on the subdomain and user/pass credentials will give you certain privileges from ADMIN / RESELLER / CLIENT / USER

In order to determine the correct privileges for the user we have built a customer LIBRARY (location:application/library) which we have called Session_management, this library DOES NOT extend the core SESSION driver/library and never has and has no extension to another class, this library is also auto-loaded, prior to CI 3.0.0 everything was working fine.

First this the Session_management does is __construct()

Code:
               $this->CI =& get_instance();
$this->CI->load->model('users');
$this->CI->load->model('clients');
$this->CI->load->model('sessions');
$this->CI->load->driver('session');
$this->CI->load->library('password_hash');
$this->CI->load->helper('url');

$this->users = $this->CI->users;
$this->clients = $this->CI->clients;
$this->sessions = $this->CI->sessions;
$this->session = $this->CI->session;
$this->password_hash = $this->CI->password_hash;

Prior to CI 3.0.0 I has no issues in using the
Code:
$this->CI->load->library('session')
but for some unknown reason (to me) I have to load it through the driver
Code:
$this->CI->load->diver('session');
- if someone could explain why this is would be great.

When a user submits their user/pass credentials a CONTROLLER session/signin is requested which runs firstly form validation, providing everything is successfully, the Session_management login method is called.

Code:
$success = $this->session_management->login($this->input->post('email'), $this->input->post('password'));

In the LOGIN method in the Session_management class a bunch of sessions are set using $this->session->set_userdata()
Code:
               $this->session->set_userdata('user_id', 0);
$this->session->set_userdata('user_name', '');
$this->session->set_userdata('client_id', 0);
$this->session->set_userdata('client_administrator', 0);
$this->session->set_userdata('reseller_administrator', 0);

However when I var_dump() the session for all its session data it has NOTHING and I can't why this is, no session data is there except my protected fields form the config, which I have double checked and triple checked and are working fine, my sess_save_path is storing the session files correctly, and the rest of the sess configs are also correct.

Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = '/Users/******/Sites/********/tmp';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

This is a development website on my local OS X iMac, as I say prior to CI 3.0.0 everything was working fine.

Any help or information or anything that could possible put me in the right direction would be appreciated.

Michael
Reply


Messages In This Thread
Sessions - Not Working - by iD30 - 06-25-2015, 09:40 AM
RE: Sessions - Not Working - by Wouter60 - 06-25-2015, 10:34 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 01:40 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 02:22 AM
RE: Sessions - Not Working - by mike7418 - 11-14-2015, 12:29 PM
RE: Sessions - Not Working - by sv3tli0 - 11-15-2015, 02:26 AM
RE: Sessions - Not Working - by mike7418 - 11-15-2015, 04:31 PM
RE: Sessions - Not Working - by Narf - 06-26-2015, 02:59 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 03:04 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 03:22 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 03:33 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 04:13 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 05:46 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 06:46 AM
RE: Sessions - Not Working - by ivantcholakov - 06-26-2015, 05:26 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 05:51 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 07:22 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 08:38 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 08:11 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 09:30 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 10:55 AM
RE: Sessions - Not Working - by iD30 - 06-29-2015, 02:15 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 09:43 AM
RE: Sessions - Not Working [SOLVED] - by Narf - 06-29-2015, 03:18 AM
RE: [SOLVED] Sessions - Not Working - by iD30 - 07-02-2015, 09:23 AM
RE: Sessions - Not Working - by Narf - 07-03-2015, 01:34 AM
RE: Sessions - Not Working - by iD30 - 07-03-2015, 01:44 AM
RE: Sessions - Not Working - by jvandemerwe - 11-25-2015, 04:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB