This topic is locked
[SOLVED]

What is keeping my sessions open?

3/26/2021 3:27:03 PM
PHPRunner General questions
K
klyle author

I have a newish PHPR 10.5 app, and am testing a variety of roles/groups in the same browser, usually Chrome or Brave.

There seems to be something unknown remembering my login, specifically the Admin login, even when I log out, clear all cookies related to the site, close the browser tabs, I can nav back to the menu page, and be recognized as the Admin user, if there is any tab open with that user logged in.

When I change from the Admin user to the guard user, the User name in the menu bar top right stays the Admin user until I click some object to which the guard user has rights, then it changes.

Going the other way, guard user to Admin user, the username updates correctly immediatly upon login.

It is like something is remembering me as the Admin user.

This should never arise in production, as most users will have only one role, but could be that there are shared computers.

Appreciate any advice on this. Maybe it is browser cache?

Best,
Ken

K
klyle author 3/27/2021

As of today, I built the app with a new JWT token, and no other app version shares this token, published the app.

Logging in as my Admin user shows me that guard is logged in, with rights to the tables accessible to that role.

Only after I click some table/link does the username in the top right, and the side menu show the correct admin user as logged in, and the full list of tables.

K
klyle author 3/27/2021

It seems that the proximate cause of this issue was the Siteground Dynamic Cache, which is not as configurable as it should be, nor can it be configured from their Site Tools.

The solution was to disable the Dynamic Cache in .htaccess, per https://www.siteground.com/kb/disable-dynamic-caching-website/

with

<IfModule mod_headers.c>
Header set Cache-Control "max-age=0,no-store"
</IfModule>

in the parent directory of the apps' folders, so that they inherit.

I would still like to understand what object it was that Siteground was caching that produced this behavior, and if there is a way to prevent it in PHPRunner, so that I can retain whatever benefits there are of the Dynamic Cache, especially for static objects.