Site ID is missing from session data!

Trying to login into openEMR . Installed Xampp as a service. Services starting fine. But when I try to login, getting the error “Site ID is missing from session data!” . and also I am not able to add any new users into users table.

strange… works absolutely fine with firefox, but above error seen only in chrome

In chrome, try it after deleting your browser history and cache.
-brady

Remember, this error stems from the Sessions variables not being recognized. If you have been logged in for a long time without activity, you will see this error. Also, I believe this will also happen if you lose connectivity for a certain period of time, then try to access OpenEMR again. This can happen for both remote and local hosts.

1 Like

@growlingflea @brady.miller Now I’m seeing this as well at first login. Site ID is missing from session data!

I’m using Red Hat’s OpenEMR Kube deployment. https://github.com/RedHatOfficial/openemr-kube

By first login do you mean from a fresh install? Have you been able to log in successfully before?

Hi Rachel,

No, unfortunately that is what happens during the initial deployment. Is this a database issue?

As a side note, I forked Red Hat’s project and I’m writing instructions for my Capstone project to make OpenEMR super easy to deploy on Openshift.com’s free-tier. openemr-kube-1/Instructions.md at nix_capstone · ryannix123/openemr-kube-1 · GitHub

  • Ryan

You want to make sure your sites/default/sqlconfig.php has the correct credentials. This is the file that is in your www directory.

@growlingflea

Hi Daniel,

I replied to another post on this same error.

I did verify the credentials are correct, although truth be told, it’s pre-populated based on some DevOps scripts, so I assume Redhat’s team got it correct.

global $disable_utf8_flag;
$disable_utf8_flag = false;

$host = ‘mysql’;
$port = ‘3306’;
$login = ‘openemr’;
$pass = ‘openemr’;
$dbase = ‘openemr’;
$db_encoding = ‘utf8mb4’;

If this is a fresh install and you have never seen the log-in screen you need to run the setup.php script.
Make sure that you have all permissions set to www-data in your /var/www/openemr folder. Also, make sure you have root permission to mysql.

If you have already installed OpenEMR and you had access to it and now you no longer have access…

OK. Lets verify that the username/password is correct. I have a feeling that it isn’t. What you need to do is log into the mysql command line using these creds. If they are incorrect you will get an error.

Then it will prompt you for a password

According to your sqlconfig.php your password is ‘openemr’

I am going to assume that the username/password is incorrect and you will see the following error:

If the username / password is correct you should get the following prompt (or something similar)

The next step is to type “show databases;”. This will list the databases that you have access to:
image

If you don’t see a database called ‘openemr’ your settings are incorrect.

Your other option is to log in as root user and create a new user/pass for your database, then update the file in your sites/default/sqlconfig.php file.

Thanks so much for the speedy reply!

Ok, the good news is that both check out.

Also, if you log into http://emr.apps.cloudapps.northwestern.edu/interface/login/login.php?site=default user admin and pass as the credentials, it does login, but then you get prompted with the session ID bug.

OK. It looks like you will have to get write permissions to change the interface/globals.php file.

On line 81 thru 86 you have the following lines

you will have to replace the ‘openemr’ with ‘emr.apps.cloudapps.northwestern.edu’ and make sure the directory is correct.

so, on my machine if I had the same domain name as you are using, un-comment the lines:

This should fix your problem. The credentials seem correct because you are able to log in and if I try to log in with incorrect credentials I don’t get the SessionID error.

Thanks, Daniel!!! Finally, I might have a solution or at least know the nature of the problem!

Do think there is a way to change this in the autoconfig deployment files? i.e., have the DevOps autoconfig echo some variables to the globals.php file?

The goal of my project is to make OpenEMR:

  1. Super easy to deploy as a Kubernetes resource.
  2. Make it the best way to deploy OpenEMR. Using the project instructions, you can deploy OpenEMR in under five minutes with a Let’s Encrypt cert.
  3. Since it’s a Kubernetes resource, OpenEMR can scale nicely based on demand.

Hi Daniel,

I’m so close to fixing this vexing problem, but I can’t figure out the webserver_root path in the container or the webroot, so while my deployments are going, i

This is the website volume in the OpenShift YAML file, but I don’t know if it’s completely relevant.

Mount: websitevolume → /var/www/localhost/htdocs/openemr/sites <small>read-write</small>

and

  volumeMounts:
    - mountPath: /var/www/localhost/htdocs/openemr/sites
      name: websitevolume

Based on that, here is what I put in the Globals.php fork that I created for this deployment:

// The webserver_root and web_root are now automatically collected in

// real time per above code. If above is not working, can uncomment and
// set manually here:
$webserver_root = "/var/www/localhost/htdocs/";
$web_root = "/var/www/localhost/htdocs/openemr";

I’ve tried a few variations without much luck.

http://emr.apps.cloudapps.northwestern.edu/interface/login/login.php?site=default

I’m getting a blank page now, so I know it’s just a matter of figuring out what the correct path is supposed to be in the globals.php

It looks like according to the link you gave me, you might want to use the info I posted earlier.

$webserver_root = “/var/www/emr.apps.cloudapps.northwestern.edu”;
$web_root = “/emr.apps.cloudapps.northwestern.edu”;

you basically want your absolute path listed as $webserver_root.

Disclaimer: I haven’t used Kubernetes resources. I generally recomend deploying on local severs since I work directly with medical practices. With cloud based solutions, OpenEMR will only work if the Internet works so in the case of a national emergency or some kind of disaster where the internet goes down, so will OpenEMR. With a local server, there will always be access as long as there is power.

1 Like

Thanks, Daniel. I’ll give a try, and anything else you might recommend!

I did ssh into the container on Openshift, but the path you listed doesn’t actually exist.

It’s /var/www/localhost/htdocs/openemr

Here is a screenshot of the initial set up screen before the final script runs to finish the installation. Maybe this is more insightful.

Interesting point about Kubernetes, hadn’t thought about that. Chick-fil-a actually runs Kubnetes clusters locally in their stores. https://www.youtube.com/watch?v=8edDcy3oeUo So, maybe down the road we should consider that for OpenEMR.

@brady.miller @RachelEllison @dixonwhitmire @growlingflea @stephenwaite

I finally fixed the session bug!!!

I added

RUN chmod -R 777 /var/lib/php/session

To my forked Docker file from the Redhat OpenEMR Kube project.

The default permissions were such that session data couldn’t write to the directory.

I can’t wait to show this off to people. Now you can deploy an auto-scaling instance of OpenEMR in OpenShift!!! Also, the container doesn’t run as root, so it’s more secure than just straight Docker.

Thanks to everyone for their help!

3 Likes

Awesome work @Ryan_Nix!

You might not want to have the permissions as 777 since that gives everyone read/write/execute acccess. You might want to have it owned by www-data:www-data or which ever user means the Apache web server.

chown -R www-data:www-data

1 Like

Thanks, Daniel. I’ll give that a try as well. I assume it’s fine since it’s running as a non-root container on OpenShift, but it never hurt to lock down to the least amount of privileges.