Skip to content

Warn that NativeSessionStorage alters session.cache_limiter #4710

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
wants to merge 0 commits into from

Conversation

mrclay
Copy link
Contributor

@mrclay mrclay commented Dec 29, 2014

Q A
Doc fix? yes
New docs? no
Applies to 2.1+
Fixed tickets (none)

We're implementing HttpFoundation (by itself) to replace our native session implementation and noticed that NativeSessionStorage eliminates the global session.cache_limiter value. I understand why it must do this, but users should be warned that the default usage prescribed in the manual will cause all pages to be sent with no cache-busting headers.

/cc @Drak

constructor sets ``session.cache_limiter`` to ``""``. If you rely on native sessions to manage cache
headers, you *must* at least pass this option to the constructor.

Example usage::
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to nest code into a note, not sure if this will work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to add 2 more spaces in the indent (the new base is the 4 spaces indent of the note directive, to create a code block, you have to indent with 4 spaces from the base, so 4 + 4 = 8).

@mrclay mrclay changed the title Warn about NativeSessionStorage altering session.cache_limiter Warn that NativeSessionStorage alters session.cache_limiter Dec 29, 2014
@@ -102,6 +102,20 @@ method.

For the sake of clarity, some key options are explained in this documentation.

.. note::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't a caution fit better here?

@mrclay
Copy link
Contributor Author

mrclay commented Dec 30, 2014

Thanks. I can make those changes.

For a future version I wonder if it would be better to make the cache_limiter option required in the constructor or just don't change it. The principle of least surprise would suggest that constructing the object should not (silently) change a very important behavior of Sessions.

@timglabisch
Copy link
Contributor

i think this is really important, altering any kind of global in a service must become a part of the documentation.
From my point of view, this could be so important that i would like you to think about if we need a cookbook article about side effects in symfony.

@mrclay
Copy link
Contributor Author

mrclay commented Jan 1, 2015

I've expanded my PR to a section on cache limiting (with a caution) which I think will be clearer.

@mrclay
Copy link
Contributor Author

mrclay commented Jan 1, 2015

Replaced by #4728. Apologies for the churn.

@mrclay mrclay closed this Jan 1, 2015
@mrclay mrclay deleted the 2.3 branch January 1, 2015 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants