8000 Document how to set session.cache_limiter · Issue #8784 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Document how to set session.cache_limiter #8784

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

Closed
goetas opened this issue Nov 30, 2017 · 2 comments
Closed

Document how to set session.cache_limiter #8784

goetas opened this issue Nov 30, 2017 · 2 comments
Assignees
Labels
hasPR A Pull Request has already been submitted for this issue. HttpFoundation
Milestone

Comments

@goetas
Copy link
goetas commented Nov 30, 2017

The current session implementation sends some "Cache" headers really similar to http://php.net/manual/en/function.session-cache-limiter.php

This behavior can be configured by setting some properties into the parameter, session.storage.options

As example:

# config/packages/framework.yaml
parameters:
    session.storage.options:
        cache_limiter: 0

If cache_limiter is 0 symfony will not set any particular header header and will fallback on what specified by http://php.net/manual/en/session.configuration.php#ini.session.cache-limiter

cache_limiter can also be set to one of the nocache, private, private_no_expire, or public vales

Related to symfony/symfony#24988 (comment)

As suggested here symfony/symfony#24988 (comment) should be documented that changing this value should be done carefully.

@goetas
Copy link
Author
goetas commented Nov 30, 2017

@nicolas-grekas checking here
https://github.com/symfony/symfony/blob/7bab5b265614de241913db27cb6654cca91f477d/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php#L36

Symfony is using the php's header function... I expect from symfony to use always a Response object as set all the headers there.. having this exception for the session was not trivial to discover...
Can't this be done using some response listener?

In my case I also had @Cache(maxage=999)... and this was generating two Cache-Control headers...

@nicolas-grekas
Copy link
Member

Symfony is using the php's header function... I expect from symfony to use always a Response object

session are an old part of the framework, this would be great, but needs a lot of work AFAIK.

was generating two Cache-Control headers

yes, that's a bit unfortunate, but is OK from semantic+http pov, so not that a big deal IMHO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. HttpFoundation
Projects
None yet
Development

No branches or pull requests

4 participants
0