Welcome Guest, Not a member yet? Register   Sign In
Migrating from 3 to 4
#1

(This post was last modified: 11-28-2023, 06:58 AM by pippuccio76.)

HI , i want migrate a project from 3 to 4 slowly .
In two subfolder of same site a put a copy of ci3 and a copy of ci4 , i can send data via post or get correctly (from two version) . The only problem is use the same session data .
 If i use the same db's table for session is it possible ?
Reply
#2

(This post was last modified: 11-28-2023, 03:06 PM by kenjis.)

FileHandler does not work if both use the same folder?

timestamp type is different. It does not work.
The table schemes seem to be the same. So it seems to work.
Why don't you try?
https://codeigniter4.github.io/CodeIgnit...base-table
https://codeigniter.com/userguide3/libra...ase-driver
Reply
#3

(11-28-2023, 03:04 PM)kenjis Wrote: FileHandler does not work if both use the same folder?

timestamp type is different. It does not work.
The table schemes seem to be the same. So it seems to work.
Why don't you try?
https://codeigniter4.github.io/CodeIgnit...base-table
https://codeigniter.com/userguide3/libra...ase-driver


Try to use file :

ci3 : 

Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_samesite'] = 'Lax';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'../../session_common';

ci4 (.env) :

Code:
  session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
  session.cookieName = 'ci_session'
  session.expiration = 7200
  session.savePath = APPPATH.'../../session_common'


this is the error :

Code:
ErrorException
mkdir(): File exists


SYSTEMPATH/Session/Handlers/FileHandler.php at line 96

89      * @param string $path The path where to store/retrieve the session
90      * @param string $name The session name
91      *
92      * @throws SessionException
93      */
94    public function open($path, $name): bool
95    {
96        if (! is_dir($path) && ! mkdir($path, 0700, true)) {
97            throw SessionException::forInvalidSavePath($this->savePath);
98        }
99
100        if (! is_writable($path)) {
101            throw SessionException::forWriteProtectedSavePath($this->savePath);
102        }
Reply




Theme © iAndrew 2016 - Forum software by © MyBB