Welcome Guest, Not a member yet? Register   Sign In
$autoload['libraries'] = array('session'); error
#1
Sad 

Hello,



Running localhost Apache with PHP Version 7.1.8 OS X Yosemite, I copied CodeIgniter into the webserver/Documents folder.



I tested it in Chrome and Safari, it works.  I started to configure it and after doing this: $autoload['libraries'] = array('session'); it broke with the following errors:


A PHP Error was encountered
Severity: Warning
Message: mkdir(): Invalid path
Filename: drivers/Session_files_driver.php
Line Number: 136
Backtrace:
File: /Library/WebServer/Documents/katana/index.php
Line: 315
Function: require_once



( ! ) Warning: Uncaught Exception: Session: Configured save path '' is not a directory, doesn't exist or cannot be created. in /Library/WebServer/Documents/katana/katana/libraries/Session/drivers/Session_files_driver.php:138 Stack trace: #0 [internal function]: CI_Session_files_driver->open('', 'ci_session') #1 /Library/WebServer/Documents/katana/katana/libraries/Session/Session.php(143): session_start() #2 /Library/WebServer/Documents/katana/katana/core/Loader.php(1281): CI_Session->__construct() #3 /Library/WebServer/Documents/katana/katana/core/Loader.php(1174): CI_Loader->_ci_init_library('Session', 'CI_', NULL, 'session') #4 /Library/WebServer/Documents/katana/katana/core/Loader.php(1037): CI_Loader->_ci_load_stock_library('Session', 'Session/', NULL, NULL) #5 /Library/WebServer/Documents/katana/katana/core/Loader.php(1082): CI_Loader->_ci_load_library('Session', NULL, NULL) #6 /Library/WebServer/Documents/katana/katana/core/Loader.php(218): CI_Loader->_ci_load_library('Session', NULL, NULL) #7 /Library/WebServer/Docum in /Library/WebServer/Documents/katana/katana/libraries/Session/drivers/Session_files_driver.php on line 138

Now what??


Thanks.
Reply
#2

The error message literally tells you what the problem is.
Reply
#3

It's a freshly unzipped setup and I have no idea where to the invalid path is...

Please enlighten me.
Reply
#4

(08-30-2017, 09:47 AM)Narf Wrote: The error message literally tells you what the problem is.

From my config file:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

I modified it as per the instructions in the user guide.
I also created the database table as specified.

Thanks.
Reply
#5

Your session configuration shows that you are using the *files* driver, but you have not set the *session_save_path* to a valid folder for the session driver to use.

https://www.codeigniter.com/user_guide/l...references
https://www.codeigniter.com/user_guide/l...les-driver

If you think you have configured it to use the database driver, the error message quite explicitly tells yoiu it is trying to use the files driver.
Reply
#6

(08-30-2017, 11:12 AM)ciadmin Wrote: Your session configuration shows that you are using the *files* driver, but you have not set the *session_save_path* to a valid folder for the session driver to use.

https://www.codeigniter.com/user_guide/l...references
https://www.codeigniter.com/user_guide/l...les-driver

If you think you have configured it to use the database driver, the error message quite explicitly tells yoiu it is trying to use the files driver.

Please see the above answer - I did what the instructions said and I also created a "sessions" folder in the applications folder.

The attached image is a screenshot of the MySQL console in a terminal window.

I followed the instructions explicitly and still the errors remain, but only when I autoload the sessions library.

Thanks.

Attached Files Thumbnail(s)
   
Reply
#7

Is the error message the same as from your original post? or are you getting a different error message now?
Reply
#8

(This post was last modified: 08-30-2017, 12:50 PM by HEKuiper.)

(08-30-2017, 12:26 PM)ciadmin Wrote: Is the error message the same as from your original post? or are you getting a different error message now?

How weird is that...

I just re-loaded the session library and this time it worked, I even have 1 record in the database plus 2 cookies...

Thanks.

PS further testing points to browser cache...
Reply




Theme © iAndrew 2016 - Forum software by © MyBB