[split] Broken database sessions (CodeIgniter 3.1.3 Released) |
Upgrade from 3.1.2 to 3.1.3 now has broken database sessions for me. Getting this in the logs:
ERROR - 2017-01-09 19:55:20 --> Severity: Warning --> Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (ci_sessions) Unknown 0 Any ideas? This was fully functional until the upgrade. If I switch to file based sessions it starts working again. (01-10-2017, 03:10 AM)Narf Wrote:(01-09-2017, 09:00 PM)skunkbad Wrote: Upgrade from 3.1.2 to 3.1.3 now has broken database sessions for me. Getting this in the logs: For me, commenting out the following code in the session database driver allows me to log in again: PHP Code: if ($this->_lock === FALSE) What happens during login is pretty standard; the session ID is regenerated after a successful login. I made a new forum post last night for this topic: https://forum.codeigniter.com/thread-67059.html Any help is appreciated.
https://www.codeigniter.com/user_guide/l...ase-driver
Does the database session table fit with the structure that was given? Maybe it needs a update? (01-10-2017, 10:14 AM)ivantcholakov Wrote: https://www.codeigniter.com/user_guide/l...ase-driver This is what I have with sess_match_ip set to FALSE: Code: CREATE TABLE IF NOT EXISTS `ci_sessions` ( and CI user guide suggests: Code: CREATE TABLE IF NOT EXISTS `ci_sessions` ( so seems the same to me.
@skunkbad
Database session driver, actual session table structure, initially empty table, CI 3.1.3, MySQL 5.7.16-0ubuntu0.16.10.1 - (Ubuntu), PHP 7.0.8-3ubuntu3 Works for me, can't see an error. Edit: The application is different, a CMS of mine. (01-10-2017, 11:28 AM)ivantcholakov Wrote: @skunkbad I don't see an error on PHP 7 either, only PHP 5.5. I guess it could be something else, like my MariaDB version. I don't know. The PHP 5.5 box actually has a more current version of MariaDB than my PHP 7 box. I'm going to try to come up with a minimalistic example of how to make it fail, but that won't be until tonight because I have no PHP 5.5 box here at work.
So, in regards to my problem with sessions and PHP 5.5, I can reproduce the problem. In the session database driver, the recent change adding the following code is the problem:
PHP Code: if ($this->_lock === FALSE) To duplicate the problem, I can simply create a test controller and run it: PHP Code: <?php When the code in the session database driver is in place, "foo" is not shown in the session once redirected. If the code in the session database driver is commented out, "foo" is shown in the session once redirected. This is in a new install of CodeIgniter 3.1.3 on Ubuntu 14.04: PHP Version 5.5.9-1ubuntu4.20 MariaDB version 10.1.20-MariaDB-1~trusty - mariadb.org binary distribution Database client version: libmysql - mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $ There isn't anything special about this LAMP setup, it's just a basic webserver. You're probably not seeing a bunch of people reporting a problem because maybe the database driver is not popular? I can try other PHP 5.5 servers if necessary. PHP 7 works fine for some reason. Edit -------- After more testing, it seems like the problem is using sess_regenerate with the parameter set to TRUE. I can even do this and instantly have an error with CI 3.1.3: PHP Code: <?php
(01-11-2017, 01:16 AM)ivantcholakov Wrote: @skunkbad Nope. Switched tables to InnoDB and no difference. (01-11-2017, 01:26 AM)skunkbad Wrote:(01-11-2017, 01:16 AM)ivantcholakov Wrote: @skunkbad hello friend have the same problem in the end did you find any solution? Thank you https://forum.codeigniter.com/thread-72366.html |
Welcome Guest, Not a member yet? Register Sign In |