Problem with session |
Hi there again
I want to access session in all controllers by using BaseController. First time to access a site it works fine, also when I navigate everytime to another site (e.g.: first I navigate to "domain.com/users", then to "domain.com/users/login"). But if I reload one site there will be an error like this: Quote:[b]Fatal error[/b]: Uncaught ErrorException: touch(): Unable to create file NULL/ci_sessionbsfep1vfs4hk2m2ndm26dlittj089hnp because No such file or directory in C:\xampp\htdocs\kighlander.local\system\Session\Handlers\FileHandler.php:252 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'touch(): Unable...', 'C:\\xampp\\htdocs...', 252, Array) #1 C:\xampp\htdocs\kighlander.local\system\Session\Handlers\FileHandler.php(252): touch('NULL/ci_session...') #2 [internal function]: CodeIgniter\Session\Handlers\FileHandler->write('bsfep1vfs4hk2m2...', '__ci_last_regen...') #3 [internal function]: session_write_close() #4 {main} thrown in [b]C:\xampp\htdocs\kighlander.local\system\Session\Handlers\FileHandler.php[/b] on line [b]252[/b] Also in the public folder is generated a directory named "NULL". In it are generated files like: Quote:ci_sessionbsfep1vfs4hk2m2ndm26dlittj089hnp What is the reason of these effects ? Is there a solution? Thanks, Kighlander Update: my controllers: BaseController: PHP Code: <?php my users controller: PHP Code: <?php
What is the value assigned to [i]$sessionSavePath[/i] in the file C:\xampp\htdocs\kighlander.local\app\Config\app.php?
My session-variables are:
PHP Code: public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'; is this helpful?
Oh, I've found the reason... After asking me the session-path I checked ALL my configuration files. And after that I store all my configuration in app/config. Before that I had a mix of that with the .env-file...
Now my app running fine. Thanks !!!
I have a same iusse before update from rc 2 to final 4.0.2.
I solve it uncoment line in BaseController to getup session service.
If you are using the .env file, you should make an adjustment as follows. Otherwise, it continues to create a NULL folder.
app.sessionSavePath = '/writable/session' #path add |
Welcome Guest, Not a member yet? Register Sign In |