Sessions and phpMyAdmin issue

writecraft wrote on Thursday, January 09, 2014:

Hi, We were having problems storing sessions in the shared /tmp folder on our server, causing a boat-load of bump-outs, so I added to /interface/globals.php around line 37:

ini_set(‘session.save_path’, ‘/usr/buncha/path/stuff/to/our/very/own/tmp/folder’);

Worked like a champ, too, but now we get an error when clicking on Administration > Other > Database saying “phpMyAdmin has no session site ID!”. So I’m thinking the phpmyadmin is still looking for the session data in the old folder. It’s not mission critical for us, since we use our own installation of phpmyadmin for most things, but is is handy now and again for taking a quick look-see in the tables.

Any ideas on where to look for where phpmyadmin in openemr gets $_SESSION data?

yehster wrote on Thursday, January 09, 2014:

https://github.com/openemr/openemr/blob/master/phpmyadmin/libraries/session.inc.php#L76

yehster wrote on Thursday, January 09, 2014:

Another simple option instead of changing code would be to edit your php.ini file so all sessions regardless of application use your specified session.save_path

writecraft wrote on Thursday, January 09, 2014:

Thanks Kevin! The server gnomes at my super-secure HIPAA compliant hosting service say editing the php.ini is not an option – that was actually my first choice.

writecraft wrote on Thursday, January 09, 2014:

It worked! Added to phpmyadmin/libraries/session.inc.php around line 40:

@ini_set(‘session.save_path’, ‘/usr/buncha/path/stuff/to/our/very/own/tmp/folder’);

Thank you so much Kevin!

writecraft wrote on Friday, January 10, 2014:

Note to others that might want to use this to get rid of frequent “Site ID is missing from session data!” errors: you must first create a /tmp folder in your website root, chmod 733, and get the full path to it. Then you can either edit session.save_path in php.ini to match that path, or add the ini_set() line to the two files referenced above.

writecraft wrote on Friday, January 10, 2014:

Discovered an even better way to do this if your host won’t allow php.ini changes – add this to your htaccess file:

php_value session.save_path “/usr/buncha/path/stuff/to/our/very/own/tmp/folder”

Then you don’t have to edit any openemr files.