getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

config.system.session.options overwriting #2270

Open pboguslawski opened 2 years ago

pboguslawski commented 2 years ago

When one configures manually session options in system.yaml i.e.

session:
[...]
  options:
    cache_limiter: private

like in

https://github.com/getgrav/grav/issues/1081#issuecomment-377124103

then saving configuration in admin resets it to

session:
[...]
  options:
    cache_limiter: null

and Grav still inserts

Pragma: no-cache

in frontend responses when sessions are enabled (required for forms to work) which makes cache headers (Expires, Cache-Control) for Grav pages useless.

Admin plugin should recognize and preserve session.options to allow Grav page caching tuning even for sessions.

rhukster commented 2 years ago

i think this is an issue with the nested nature of the configuration settings for session, The whole options: is getting replaced by the admin section. So that means that any 'custom' options added that are not defined in the blueprints is lost.

Currently there is no option for cache_limiter so that would need to be added here: https://github.com/getgrav/grav/blob/develop/system/blueprints/config/system.yaml#L1375-L1500