Session issues migrating between hosts [solved]

Permalink
Hi
So I have moved a completed 5.7.5.9 site to a new web host and I get an exception related to tmp sessions - it appears to be trying to open a tmp file that does not currently exist in the site's /tmp folder (there are other session files in there though).

New website gives this exception:

An unexpected error occurred.
session_start(): open({home}/httpdocs/sa/tmp/sess_8d193tu7agufh3jraimuvtm254, O_RDWR) failed: No such file or directory (2)

The new host is running php 5.3.3 (whereas my dev host runs php 5.5.38), which could be the issue (I read a comment under this post which may be relevant relating to Symfonyhttp://documentation.concrete5.org/tutorials/session-handling-in-co...

I also had to correct a path in concrete/src/Session/Storage/Handler/NativeFileSessionHandler.php which had the old site path there post-migration (throwing another exception), so it should hopefully be pointing at the correct place now.

I've had lots of success with migrating Concrete5.6 sites in the past - this is the first 5.7 one I've done. Any of this familiar?

Thanks in advance!
Ed

NB (edit)
To complicate matters - new host is run by a third party acting for my client so I am not yet able to post the URLs in a public forum, although at the moment this probably wouldn't help much anyway...

 
jasteele12 replied on at Permalink Best Answer Reply
jasteele12
You should definitely not have to modify concrete/ core files (and there should not be any kind of hard-coded path set in that file).

Running multiple sites off one core wouldn't work at all if it was - it uses PHP's ini session.save_path

PHP 5.3.3 is very old, and slow :(

To start, I'd get a fresh copy of an unmodified concrete/ directory.

Yay, c5's forum URL mungler is still here, the link you wanted: http://documentation.concrete5.org/tutorials/session-handling-in-co...

Anyway, here's how I think you're supposed to override the session/cookie path (to a directory that you know exists and is writeable by the webserver:
<?php /* application/config/concrete.php - for overrides concrete/config/concrete.php */
return array(
    'session' => array(
        'save_path' => '/home/path-to-your-site/application/files/tmp/',
        'cookie' => array(
            'cookie_path' => '/home/path-to-your-site/application/files/tmp/',
        ),
    ),
);
avra replied on at Permalink Reply
Updating to PHP 5.5 fixed this immediately, thanks for your help.
jasteele12 replied on at Permalink Reply
jasteele12
Glad you got it sorted, 5.6 would be even better ;)

Still not sure why you would have to change a core file in the first place...
avra replied on at Permalink Reply
Yep - this was (incorrect) advice from another dev who is not familiar with C5.

Long story short, just starting again with 5.5.8 and the same migrated files, the old path is no longer there in the core file and everything is sorted
+ I've learnt a bit more about C5 so thank you!

Ed
jasteele12 replied on at Permalink Reply
jasteele12
Hmmm, never got notified you replied...

You are most welcome and congrats on beginning your concrete5 journey!