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

(06-25-2015, 10:34 AM)Wouter60 Wrote: You are wrong about loading the session as a driver.
Just like before, it must be loaded as a library:







PHP Code:
$this->load->library('session'); 
Check the documentation for that.

The tricky part is configuring the session settings.
I didn't get it working with $config['sess_driver'] = 'files';
Therefore, I switched to $config['sess_driver'] = 'database';  and I added a ci_sessions table to my database.
No problems with sessions since then.

Thanks for your reply Wouter60, however, in my problem I said I "HAVE" to load it as a driver, I don't have a choice, I also asked if someone could explain why I have that would be great. I have read the documentation and have seen how to initialise the session library -  http://www.codeigniter.com/userguide3/li...-a-session 

If I do attempt to load it as a library
Code:
$this->load->library('session')

This is what I get
Code:
A PHP Error was encountered

Severity: Notice
Message: Undefined property: Session::$session
Filename: libraries/Session_management.php
Line Number: 38

For your ref: line 38 is:
Code:
$this->session = $this->CI->session;

This is after trying to load the session library
Code:
$this->CI->load->library('session');

Any further help would be appreciated
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