Skip to content

Update sessions.rst #7643

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 4 commits into from
Closed

Conversation

ThomasLandauer
Copy link
Contributor

First step to explain how to activate Namespaced Attributes, as requested by #7378

First step to explain how to activate Namespaced Attributes, as requested by symfony#7378
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

One minor comment, nice PR, thanks!


:method:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface::remove`
Deletes an attribute by key.
Deletes an attribute by name.
Copy link
Contributor

Choose a reason for hiding this comment

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

and returns its value.

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

👍

@xabbuh xabbuh added this to the 2.7 milestone May 15, 2017
@drupol
Copy link

drupol commented Oct 23, 2017

Hi,

I would rather use a valid syntax example for config.yml:

services:
    session:
      class: Symfony\Component\HttpFoundation\Session\Session
      arguments: ["@session.storage", "@session.namespacedattributebag", "@session.flash_bag"]

    session.namespacedattributebag:
      class: Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag

@ThomasLandauer
Copy link
Contributor Author

Sorry, don't know what you mean - can't remember all details half a year later....

Do you want to add something, or do you want me to change something?

session:
class: Symfony\Component\HttpFoundation\Session\Session
arguments:
- @session.storage
Copy link

Choose a reason for hiding this comment

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

shouldn't it be @session.storage.native?

Copy link
Member

Choose a reason for hiding this comment

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

@HeahDude you approved this PR ... but I'd like to ask you what do you think about this comment from @mhabibi. Do you agree with it? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't care about the implementation here, so we don't need to be specific in that case and the alias is used. From Symfony 3.3, it should SessionStorageInterface instead (autowired by default). See https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml#L21, that keeps BC with the old alias.
We can merge as is, thanks!

@javiereguiluz javiereguiluz modified the milestones: 2.7, 2.8 May 28, 2018
@javiereguiluz
Copy link
Member

@ThomasLandauer sorry it took us so long to merge this. I like a lot your improvements. I only removed some example that showed how to configure this on Symfony. Since this is the stand-alone component doc, we never show how to integrate it with the whole framework. Thanks!

javiereguiluz pushed a commit that referenced this pull request Jul 24, 2018
As requested here :-) #7643 (review)
javiereguiluz added a commit that referenced this pull request Jul 24, 2018
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #7643).

Discussion
----------

Update sessions.rst

First step to explain how to activate Namespaced Attributes, as requested by #7378

Commits
-------

22206d4 Reword and simplify
e9dffc6 Update sessions.rst
5254aee Removed some repeated content and minor rewords
73a02c2 Update sessions.rst
@ThomasLandauer ThomasLandauer deleted the patch-10 branch August 17, 2018 10:01
@pbowyer
Copy link
Contributor

pbowyer commented Oct 16, 2018

@javiereguiluz Can the examples that showed how to configure Symfony be added to the Symfony session documentation? It took ma a while to find this PR to confirm how to use NamespacedAttributeBag with Symfony 4.

@javiereguiluz
Copy link
Member

@pbowyer I've created #10494 to not forget about this. Thanks!

Guikingone pushed a commit to Guikingone/symfony-docs that referenced this pull request Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants