Problem/Motivation
Part of #2959269: [meta] Core should not trigger deprecated code except in tests and during updates.
This is another one that seems to be reported on every request, so also setting the priority to major.
Need to see what exactly we need to do, just removing the proxy class resolves it, wondering if we have test coverage for that lazy writing, I hope so...
Proposed resolution
- Merge functionality into
\Drupal\Core\Session\WriteSafeSessionHandler
/session_handler.write_safe
service - Remove
session_handler.write_check
service - Open follow-up to use built-in PHP functionality - [#3001185]
Remaining tasks
User interface changes
None
API changes
session_handler.write_check
service is removed
Data model changes
None
Release notes snippet
The service session_handler.write_check
has been removed from core.services.yml
. In the unlikely event that this service is being swapped out the functionality has been moved to \Drupal\Core\Session\WriteSafeSessionHandler
- the session_handler.write_safe
service.
Comment | File | Size | Author |
---|---|---|---|
#28 | 2961861-3-28.patch | 3.61 KB | alexpott |
#28 | 15-28-interdiff.txt | 735 bytes | alexpott |
#15 | 2961861-2-15.patch | 3.6 KB | alexpott |
Comments
Comment #2
BerdirComment #3
BerdirComment #5
BerdirHm, the alternative mentioned in the message doesn't make sense for us. We specifically don't want to do any updates, also not the timestamp.
I guess we should just copy the class to our namespace and keep using it? Or put the relevant logic in \Drupal\Core\Session\SessionHandler?
Comment #6
alexpottShould also be able to remove this deprecation here too.
I think it is reasonable to merge this functionality into \Drupal\Core\Session\WriteSafeSessionHandler
Comment #7
BerdirYeah, was thinking to do the same, makes sense and is pretty simple then. Looks good to me.
Comment #8
alexpottI kept this as private because it makes sense that this info should never leak out of this object. It's private in Symfony's implementation.
Comment #9
alexpottI think once we support only PHP 7.0 then we can probably remove this completely and use http://php.net/manual/en/session.configuration.php#ini.session.lazy-write
Comment #10
Mile23Outdated duplicate: #2937540: Remove usages of Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler
Related: #2937541: [PP-1] The "session_handler.write_check" service relies on the deprecated WriteCheckSessionHandler class
Comment #11
BerdirI think the "sessionId => session" part violates our coding standard?
Comment #12
Mile23Needs follow-up for the work in #9, with a @todo.
Comment #14
PasqualleAs I see we are free to use PHP 7 here. I am not sure if I understand the issue, but I hope it helps.
Comment #15
alexpottFixed #11. I'm not sure about adding an @todo. There is plenty of session changes we can make once we are PHP 7 only. Happy to open an issue though. Opened #3001180: Use session.lazy-write once Drupal 8 only supports PHP 7
Comment #16
alexpottI think removing this service in a minor is okay because it is like an event subscriber and not really meant to be overridden. Should have a CR though.
Comment #17
alexpottCreated https://www.drupal.org/node/3001185
Comment #18
PasqualleI do not understand, Drupal 8.7 is PHP 7 only. And this issue should not be backported to 8.6.
So why not solve it with PHP 7?
Comment #19
alexpott@Pasqualle because there is an idea of maintaining PHP 5.6 support in 8.7.x unless we really can't.
Comment #20
larowlanaccording to http://grep.xnddx.ru/search?text=session_handler.write_check the only uses of this are in the IDE helper project, which is a meta project
but I will defer to release manager on this, in an ideal world, we'd mark it private in one minor and remove in another, but I don't think it warrants that effort - a change record and release notes snippet will suffice in my opinion
Tagging for release manager review, and we need a release notes snippet here
Comment #21
catchAgreed this is fine in a minor with a change record, thanks for opening the follow-up issue.
Looks RTBC to me too.
Comment #23
andypostComment #24
larowlanWe still need a release notes snippet here, then can go back to RTBC
Comment #25
alexpottUpdated issue summary.
Comment #26
alexpottComment #27
larowlanbecause we return early, we don't need the elseif and else here
Comment #28
alexpottDone. Considering there's no real change straight back to RTBC.
Comment #30
larowlanCommitted 9498875 and pushed to 8.7.x. Thanks!
Published change record