-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle][HttpFoundation][Security] Deprecate service "session" #38616
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
Conversation
src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Resources/config/session.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php
Outdated
Show resolved
Hide resolved
6ccd212
to
dea1e7e
Compare
hmmm what's about renaming service In that way internal services will inject the |
internal services should be refactored IMHO to use the new approach :) if the session service itself is deprecated, no need for an alias id say. |
issue is, we can't register 2 A solution would be to check if the service is used to decide if the application should keep the old deprecated |
dea1e7e
to
6038d48
Compare
and shouldnt also :) cant we create a deprecated service factory instead? |
Ah, i figured. If the user created an overridden/independent Sounds like we need a check a la |
6038d48
to
dd1ce2c
Compare
79d1158
to
6584d06
Compare
bbe492d
to
1670747
Compare
d58f8b2
to
b9ba274
Compare
src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php
Outdated
Show resolved
Hide resolved
caec7c1
to
6d608e4
Compare
src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php
Show resolved
Hide resolved
src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php
Outdated
Show resolved
Hide resolved
fba5556
to
b8d9d91
Compare
b8d9d91
to
1718ddb
Compare
1718ddb
to
54acc00
Compare
Thank you @jderusse. |
This is a attempt to deprecate service
session
andSessionInterface
.This PR replaces the
session
service by a.session.do-not-use
service (used internally by Symfony) and makesession
a deprecated alias.In Symfony 6.0 we can remove the
session
service and replace theSessionListener
by a Factory that build the session (instead of fetching it from container)This PR also add a short cut
RequestStack::getSession(): ?SessionInterface
For backward compatibility the
SessionListener
is replaced byFactorySessionListener
only when the user don't override the servicesession
(ping @wouterj )TODO: