-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiuser: Blank screen after leaving it logged in for a while #5
Comments
We are actually losing three of the session variables; username, userid, and role. |
Ok, this problem happens when the session file gets wiped from the server. I.e., /var/lib/php/session/sess_something. When that happens, the server generates a new session with the same ID, based on the session variable being sent in from the browser. The newly recreated session is missing some of the variables. |
I've been able to improve the situation slightly.
On the client side, the gray screen problem still happens, but it is cleared to a "logged out" state when you hit refresh. So a definite improvement, as it is no longer necessary to clear the session cookie manually. |
The problem comes from this commit; 24444de In order for that to be able to work, you would need to feed back all of the variables that are stored in the session. In addition to what it is able to recover, that means username, userid, and role. However, given that username and role can be looked up from the database knowing userid, userid itself should be adequate. |
Would this be the first commit related to multi-user? |
This situation occurs after the client has been logged in for some time, without any activity. A client refresh will yield a GRAY screen, with a black line separating the header section from the body, but no data or buttons present.
In this situation, the $_SESSION array has two keys set; login = 1, identifier = ....
In addition, the role mode selection in php/api.php falls into GUEST mode, which is inconsistent with login = 1.
At this point, forcing it back into the same "role" that it was previously logged in as will return the functionality to normal. I do this by replacing the entire "if (admin) else if (user) else" block with the following;
$_SESSION['role'] = "admin";
define('LYCHEE_ACCESS_ADMIN', true);
$admin = new Admin($database, $plugins, $settings);
$admin->check($fn);
So what is happening, is it is losing the "role" variable of the session.
I will look into this more tomorrow.
The text was updated successfully, but these errors were encountered: